/* =========================================================================
   薪酬驾驶舱 · 飞书风格 UI Kit
   ---------------------------------------------------------------------------
   设计基调：飞书（Lark）企业后台
   - 主色：Lark Blue #3370FF
   - 基底：冷灰 #F5F6F7，克制层级，浅边框代替阴影
   - 圆角：中小（6 / 8 / 12）
   - 字体：PingFang SC / HarmonyOS Sans / Microsoft YaHei
   - 密度：中等偏密，行高 1.5
   兼容性：沿用旧模板的语义类名（panel / chip / nav-link / field ...），
          所有 35+ 页面无需改动即可统一换肤。
   ========================================================================= */

:root {
  /* 色板 — 飞书蓝主色系 */
  --brand: #3370ff;
  --brand-hover: #4e86ff;
  --brand-active: #245bdb;
  --brand-strong: #245bdb;
  --brand-soft: rgba(51, 112, 255, 0.08);
  --brand-soft-strong: rgba(51, 112, 255, 0.14);
  --brand-ring: rgba(51, 112, 255, 0.2);

  /* 中性 */
  --bg: #f5f6f7;
  --bg-soft: #f7f8fa;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-muted: #f7f8fa;
  --surface-hover: #f2f3f5;

  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --border-soft: #f2f3f5;

  --text: #1f2329;
  --text-muted: #4e5969;
  --text-faint: #86909c;
  --text-disabled: #c9cdd4;

  /* 功能色 */
  --success: #00b42a;
  --success-soft: #e8f8ee;
  --warning: #ff7d00;
  --warning-soft: #fff3e8;
  --danger: #f53f3f;
  --danger-soft: #ffece8;
  --info: #3370ff;
  --info-soft: rgba(51, 112, 255, 0.08);

  /* 尺寸 */
  --sidebar-width: 232px;
  --sidebar-collapsed: 64px;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  /* 阴影 — 克制 */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-pop: 0 6px 16px rgba(15, 23, 42, 0.1);

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------------------------------
   基础
   ------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 0;
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "HarmonyOS Sans",
    "Microsoft YaHei", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--brand-hover);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  padding: 8px 16px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus {
  top: 8px;
  color: #fff;
}

/* -------------------------------------------------------------------------
   表单控件
   ------------------------------------------------------------------------- */
button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}

input,
select {
  height: 32px;
}

textarea {
  padding: 8px 12px;
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-muted);
  color: var(--text-disabled);
  cursor: not-allowed;
}

select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%234E5969' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.3' d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

input[type="file"] {
  padding: 4px;
  height: auto;
  cursor: pointer;
}

/* -------------------------------------------------------------------------
   按钮 — 飞书标准
   ------------------------------------------------------------------------- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  height: 32px;
  padding: 0 16px;
  color: #ffffff;
  font-weight: 500;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

button:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

button:active {
  background: var(--brand-active);
  border-color: var(--brand-active);
}

button:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}

button:disabled {
  background: var(--border);
  border-color: var(--border);
  color: var(--text-faint);
  cursor: not-allowed;
}

.ghost-button,
a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  height: 32px;
  padding: 0 16px;
  color: var(--text);
  font-weight: 500;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.ghost-button:hover {
  color: var(--brand);
  background: var(--surface-solid);
  border-color: var(--brand);
}

.ghost-button:active {
  color: var(--brand-active);
  border-color: var(--brand-active);
}

.ghost-button.active {
  color: var(--brand);
  background: #eef4ff;
  border-color: var(--brand);
}

.primary-button,
a.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  height: 32px;
  padding: 0 16px;
  color: #ffffff;
  font-weight: 600;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

.primary-button:hover,
a.primary-button:hover {
  color: #ffffff;
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 8px 20px rgba(51, 112, 255, 0.18);
}

.primary-button:active,
a.primary-button:active {
  background: var(--brand-active);
  border-color: var(--brand-active);
}

.text-link {
  color: var(--brand);
  font-weight: 500;
  transition: color var(--transition);
}

.text-link:hover {
  color: var(--brand-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

button:disabled,
.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

/* -------------------------------------------------------------------------
   表格
   ------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-soft);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

td.num,
th.num,
.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover td {
  background: var(--surface-muted);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* -------------------------------------------------------------------------
   Shell 布局
   ------------------------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
  transition: grid-template-columns var(--transition-slow);
}

.shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  overflow: hidden;
  background: var(--surface-solid);
  border-right: 1px solid var(--border);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 12px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-inner::-webkit-scrollbar {
  width: 4px;
}
.sidebar-inner::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* 品牌区 */
.brand {
  padding: 4px 8px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3370ff, #5b8cff);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(51, 112, 255, 0.25);
}

.brand-kicker {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 4px 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.brand p {
  margin: 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brand-meta {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.brand-meta span {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 500;
}

/* 侧边栏折叠按钮 */
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
}

.sidebar-toggle:active,
.sidebar-toggle:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.sidebar-toggle-icon {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-block;
}

.sidebar-toggle-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 2px;
  height: 10px;
  background: currentColor;
  border-radius: 1px;
}

.sidebar-toggle-icon::after {
  content: "";
  position: absolute;
  right: 0;
  top: 3px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(-135deg);
  transition: transform var(--transition);
}

.shell.sidebar-collapsed .sidebar-toggle-icon::after {
  transform: rotate(45deg);
}

.toggle-label {
  display: none;
}

/* 导航 */
.nav {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.nav-section {
  display: grid;
  gap: 2px;
  padding: 6px 0;
}

.nav-section + .nav-section {
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
  padding-top: 10px;
}

.nav-label {
  padding: 4px 12px 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  transition: background var(--transition), color var(--transition);
}

.nav-link::before {
  content: attr(data-short);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background var(--transition), color var(--transition);
}

.nav-link > span:not(.nav-badge) {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: inherit;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link > span:not(.nav-badge) small {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link.compact {
  align-items: center;
}

.nav-link.compact small {
  display: none;
}

.nav-badge {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.nav-badge--danger {
  background: rgba(245, 63, 63, 0.12);
  color: var(--danger);
}

.nav-badge--warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.nav-link:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-link:hover::before {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-link.active::before {
  background: var(--brand);
  color: #ffffff;
}

.nav-link.active > span:not(.nav-badge),
.nav-link.active small {
  color: var(--brand);
}

/* 侧边栏收起态 */
.shell.sidebar-collapsed .brand h1,
.shell.sidebar-collapsed .brand p,
.shell.sidebar-collapsed .brand-kicker,
.shell.sidebar-collapsed .brand-meta,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-link span,
.shell.sidebar-collapsed .nav-link small,
.shell.sidebar-collapsed .sidebar-note {
  display: none;
}

.shell.sidebar-collapsed .brand {
  padding: 4px 0 12px;
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
}

.shell.sidebar-collapsed .brand-header {
  margin: 0;
  justify-content: center;
}

.shell.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 7px 0;
}

.shell.sidebar-collapsed .nav-link::before {
  margin: 0;
}

.shell.sidebar-collapsed .sidebar-inner {
  padding: 16px 8px 12px;
}

.sidebar-note {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1px solid rgba(51, 112, 255, 0.14);
}

.sidebar-note strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-strong);
}

.sidebar-note span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.footer-nav {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.footer-nav + .sidebar-note {
  margin-top: 10px;
}

/* -------------------------------------------------------------------------
   主区域
   ------------------------------------------------------------------------- */
.mobile-backdrop {
  display: none;
}

.main {
  min-width: 0;
  padding: 0;
}

/* 页头 */
.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border);
}

.page-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.page-copy {
  min-width: 0;
}

.page-kicker {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.page-copy h2 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.page-subtitle {
  display: none;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.page-actions,
.header-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.header-meta {
  padding-right: 8px;
  border-right: 1px solid var(--border-soft);
}

.header-meta:last-child {
  border-right: none;
  padding-right: 0;
}

.notification-popover {
  position: relative;
}

.header-logout-form {
  margin: 0;
}

.header-logout-button {
  min-width: auto;
  height: 30px;
  padding: 0 10px;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.header-logout-button:hover {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff5f5;
}

.notification-trigger {
  position: relative;
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.notification-trigger:hover {
  color: var(--brand);
  border-color: rgba(51, 112, 255, 0.28);
  background: var(--brand-soft);
}

.notification-trigger.has-unread {
  color: var(--brand);
  border-color: rgba(51, 112, 255, 0.24);
  background: var(--surface-solid);
}

.notification-trigger__icon {
  width: 16px;
  height: 16px;
  display: block;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface-solid);
}

.notification-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 86vw);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  z-index: 80;
  overflow: hidden;
}

.notification-menu__head,
.notification-menu__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.notification-menu__head strong {
  font-size: 13px;
  color: var(--text);
}

.notification-menu__head a,
.notification-menu__foot button {
  font-size: 12px;
  color: var(--brand);
  background: transparent;
  border: 0;
  padding: 0;
  min-width: 0;
  height: auto;
  text-decoration: none;
  cursor: pointer;
}

.notification-menu__foot {
  border-top: 1px solid var(--border-soft);
  border-bottom: 0;
  justify-content: flex-end;
  margin: 0;
}

.notification-menu__list {
  display: grid;
  max-height: 320px;
  overflow-y: auto;
}

.notification-menu__item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-soft);
}

.notification-menu__item:hover {
  background: var(--surface-hover);
}

.notification-menu__item span {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.notification-menu__item small {
  color: var(--text-faint);
  font-size: 11px;
}

.notification-menu__item.is-unread {
  background: rgba(51, 112, 255, 0.06);
}

.notification-menu__empty {
  padding: 18px 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.main-inner {
  display: grid;
  gap: 16px;
  padding: 16px 24px 32px;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
}

.inline-mini {
  display: inline-flex;
  margin: 0;
}

.inline-mini button {
  min-width: auto;
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(245, 63, 63, 0.28);
}

.danger-button:hover {
  background: rgba(245, 63, 63, 0.14);
  color: var(--danger);
}

/* -------------------------------------------------------------------------
   Chip / Tag
   ------------------------------------------------------------------------- */
.chip,
.sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}

.chip.soft {
  background: var(--brand-soft);
  color: var(--brand);
}

.chip.subtle {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-color: var(--border-soft);
}

.chip.success,
.status-chip.status-approved {
  background: var(--success-soft);
  color: var(--success);
}

.chip.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip.release-chip {
  background: var(--brand);
  color: #ffffff;
}

.chip.role-chip {
  background: rgba(51, 112, 255, 0.1);
  color: var(--brand);
  border-color: rgba(51, 112, 255, 0.15);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-chip.status-submitted,
.status-chip.status-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-chip.status-draft {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.status-chip.status-rejected,
.status-chip.status-returned {
  background: var(--danger-soft);
  color: var(--danger);
}

.entity-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.entity-cell.compact {
  gap: 6px;
  margin: 2px 0;
}

.entity-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.entity-avatar.mini {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.entity-avatar.placeholder {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.avatar-upload {
  --avatar-size: 64px;
  width: var(--avatar-size);
  max-width: var(--avatar-size);
  flex: 0 0 var(--avatar-size);
}

.avatar-upload-sm {
  --avatar-size: 40px;
}

.avatar-upload-md {
  --avatar-size: 56px;
}

.avatar-upload-lg {
  --avatar-size: 82px;
}

.avatar-upload-xl {
  --avatar-size: 96px;
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: var(--avatar-size);
}

.avatar-upload-trigger {
  position: relative;
  width: var(--avatar-size);
  height: var(--avatar-size);
  max-width: var(--avatar-size);
  max-height: var(--avatar-size);
  min-width: var(--avatar-size);
  min-height: var(--avatar-size);
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.avatar-upload-trigger.static {
  cursor: default;
}

.avatar-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-upload-input[hidden] {
  display: none !important;
}

.avatar-upload-img,
.avatar-upload-fallback {
  width: var(--avatar-size) !important;
  height: var(--avatar-size) !important;
  max-width: var(--avatar-size) !important;
  max-height: var(--avatar-size) !important;
  border-radius: inherit;
  flex: 0 0 var(--avatar-size);
}

.avatar-upload-img[hidden],
.avatar-upload-fallback[hidden] {
  display: none !important;
}

.avatar-upload-img {
  object-fit: cover;
  display: block;
}

.avatar-upload-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: calc(var(--avatar-size) * 0.34);
  color: #2563eb;
  background: radial-gradient(circle at 30% 20%, #ffffff 0, #e0f2fe 42%, #dbeafe 100%);
}

.avatar-upload-fallback.upload-text {
  padding: 0 14px;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  color: #245bdb;
  background: linear-gradient(145deg, #f8fbff 0%, #e8f1ff 100%);
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  box-shadow: 0 4px 12px rgba(51, 112, 255, 0.18);
}

.help-tip__content {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 60;
  width: max-content;
  max-width: min(360px, 72vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.help-tip__content::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: translate(-50%, -6px) rotate(45deg);
}

.help-tip:hover .help-tip__content,
.help-tip:focus .help-tip__content,
.help-tip:focus-within .help-tip__content {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.avatar-upload-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 6px 4px;
  background: rgba(15, 23, 42, 0.66);
  color: #fff;
  font-size: 12px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.16s ease;
  pointer-events: none;
}

.avatar-upload-trigger:hover .avatar-upload-overlay,
.avatar-upload-trigger:focus-within .avatar-upload-overlay {
  transform: translateY(0);
}

.avatar-upload-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.avatar-upload-with-copy {
  width: auto !important;
  max-width: 100% !important;
  flex: 0 1 auto;
}

.avatar-upload-with-copy .avatar-upload-row {
  width: auto !important;
  max-width: 100%;
}

.avatar-upload-with-copy .avatar-upload-copy {
  min-width: 10rem;
}

.entity-cell .avatar-upload-copy,
.official-live-table .avatar-upload-copy {
  display: none;
}

.avatar-source-label,
.avatar-upload-hint,
.avatar-upload-meta {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.avatar-upload-meta {
  color: var(--primary);
}

.avatar-upload.is-uploading .avatar-upload-trigger::after {
  content: "上传中";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.avatar-upload.has-error .avatar-upload-meta {
  color: var(--danger);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.official-live-table {
  min-width: 1120px;
  table-layout: fixed;
}

.official-live-table th:nth-child(1),
.official-live-table td:nth-child(1) {
  width: 116px;
}

.official-live-table th:nth-child(2),
.official-live-table td:nth-child(2) {
  width: 220px;
}

.official-live-table th:nth-child(3),
.official-live-table td:nth-child(3) {
  width: 150px;
}

.official-live-table th:nth-child(4),
.official-live-table td:nth-child(4) {
  width: 180px;
}

.official-live-table th:nth-child(5),
.official-live-table td:nth-child(5),
.official-live-table th:nth-child(6),
.official-live-table td:nth-child(6),
.official-live-table th:nth-child(7),
.official-live-table td:nth-child(7),
.official-live-table th:nth-child(8),
.official-live-table td:nth-child(8) {
  width: 98px;
}

.official-live-table th:nth-child(9),
.official-live-table td:nth-child(9) {
  width: 160px;
}

.official-live-table th:nth-child(10),
.official-live-table td:nth-child(10) {
  width: 150px;
}

.official-live-table .entity-cell {
  display: flex;
  min-width: 0;
}

.official-live-table .entity-cell > div:last-child {
  min-width: 0;
}

.official-live-table .entity-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-live-table .avatar-upload,
.official-live-table .avatar-upload-row,
.official-live-table .avatar-upload-trigger,
.official-live-table .avatar-upload-img,
.official-live-table .avatar-upload-fallback {
  --avatar-size: 40px;
}

.official-live-table td {
  overflow-wrap: normal;
}

.official-business-panel,
.diagnostic-panel,
.nested-panel,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}

.official-live-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.business-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.overview-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

a.overview-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.overview-card span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.overview-card strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.overview-card small {
  color: var(--text-faint);
  font-size: 12px;
}

.overview-card.warning::before,
.overview-card.danger::before,
.overview-card.action::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.overview-card.warning::before { background: var(--warning); }
.overview-card.danger::before { background: var(--danger); }
.overview-card.action::before { background: var(--brand); }

.overview-card.warning strong { color: var(--warning); }
.overview-card.danger strong { color: var(--danger); }
.overview-card.action strong { color: var(--brand); }

.sync-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
}

.sync-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sync-panel__header strong {
  font-size: 15px;
}

.sync-panel__note {
  color: var(--text-muted);
  font-size: 12px;
}

.sync-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.2fr) minmax(170px, 1fr) minmax(170px, 1fr);
  gap: 12px;
  align-items: end;
}

.sync-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  grid-column: 1 / span 3;
}

.sync-submit {
  display: flex;
  justify-content: flex-end;
}

.main,
.main-inner,
.panel,
.table-toolbar,
.entity-cell > div {
  min-width: 0;
}

.nowrap-cell {
  white-space: nowrap;
}

.time-cell {
  min-width: 74px;
}

.time-main {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.ellipsis-text {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-stack {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inline-details {
  margin-top: 4px;
  color: var(--text-muted);
}

.inline-details > summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 12px;
  list-style: none;
}

.inline-details > summary::-webkit-details-marker {
  display: none;
}

.danger-text {
  color: var(--danger);
}

.segmented-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diagnostic-panel > summary {
  cursor: pointer;
  list-style: none;
}

.diagnostic-panel > summary::-webkit-details-marker {
  display: none;
}

.nested-panel {
  margin-top: 16px;
  box-shadow: none;
}

/* -------------------------------------------------------------------------
   Panel / 卡片
   ------------------------------------------------------------------------- */
.panel {
  position: relative;
  padding: 20px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}

.panel-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel + .panel {
  margin-top: 0;
}

.hero-card,
.dashboard-hero {
  background: var(--surface-solid);
  border-color: var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 24px;
}

.dashboard-hero-copy {
  min-width: 0;
}

.dashboard-hero-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.eyebrow {
  display: inline-block;
  padding: 2px 8px;
  margin-bottom: 8px;
  border-radius: var(--radius-xs);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  margin: 4px 0 8px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.hero-copy {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.hero-actions,
.quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.quick-action-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition),
    transform var(--transition);
}

.quick-action-card:hover {
  color: var(--text);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.quick-action-card strong {
  font-size: 14px;
}

.quick-action-card span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.metric-tile {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.metric-tile span {
  color: var(--text-faint);
  font-size: 12px;
}

.metric-tile strong {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-filter-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.hero-filter-form .field {
  margin: 0;
  flex: 1;
}

.health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.health span {
  color: var(--text-muted);
  font-size: 13px;
}

.health strong {
  font-size: 14px;
  font-weight: 600;
}

.health.is-good {
  background: var(--success-soft);
  border-color: rgba(0, 180, 42, 0.2);
}
.health.is-good strong {
  color: var(--success);
}
.health.is-warn {
  background: var(--warning-soft);
  border-color: rgba(255, 125, 0, 0.2);
}
.health.is-warn strong {
  color: var(--warning);
}
.health.is-danger {
  background: var(--danger-soft);
  border-color: rgba(245, 63, 63, 0.2);
}
.health.is-danger strong {
  color: var(--danger);
}

.notice-panel {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--info-soft);
}

.notice-panel strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-strong);
}

.notice-panel p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.notice-info {
  background: var(--info-soft);
  border-color: rgba(51, 112, 255, 0.16);
}
.notice-panel.warning {
  background: var(--warning-soft);
  border-color: rgba(255, 125, 0, 0.2);
}
.notice-panel.warning strong {
  color: var(--warning);
}
.notice-panel.danger {
  background: var(--danger-soft);
  border-color: rgba(245, 63, 63, 0.2);
}
.notice-panel.danger strong {
  color: var(--danger);
}

.info-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border-soft);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row span {
  color: var(--text-muted);
  font-size: 13px;
}

.info-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.empty-state {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.empty-state span {
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.6;
  max-width: 380px;
}

.hint-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.hint-card strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.hint-card p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.hint-card.danger {
  border-color: rgba(245, 63, 63, 0.28);
  background: #fff1f0;
}

.hint-card.danger strong {
  color: #c7362f;
}

.hint-card.danger p {
  color: #7a2e2b;
}

/* -------------------------------------------------------------------------
   内容网格
   ------------------------------------------------------------------------- */
.content-grid {
  display: grid;
  gap: 16px;
}

.content-grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

@media (max-width: 1180px) {
  .content-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }
}

.stack-grid {
  display: grid;
  gap: 16px;
  align-content: start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.stat-value {
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-note {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}

.stat-card.accent {
  border-left: 3px solid var(--brand);
}
.stat-card.accent .stat-value { color: var(--brand-strong); }

.stat-card.warning {
  border-left: 3px solid var(--warning);
}
.stat-card.warning .stat-value { color: var(--warning); }

.stat-card.info {
  border-left: 3px solid var(--info);
}
.stat-card.info .stat-value { color: var(--info); }

.stat-card.danger {
  border-left: 3px solid var(--danger);
}
.stat-card.danger .stat-value { color: var(--danger); }

.stat-card.success {
  border-left: 3px solid var(--success);
}
.stat-card.success .stat-value { color: var(--success); }

/* -------------------------------------------------------------------------
   问题卡片（dashboard issue cards）
   ------------------------------------------------------------------------- */
.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dashboard-badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.issue-card {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}

.issue-card.is-clickable:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.issue-card.is-empty {
  opacity: 0.72;
}

.issue-card.danger {
  border-top: 3px solid var(--danger);
}

.issue-card.warning {
  border-top: 3px solid var(--warning);
}

.issue-card.neutral {
  border-top: 3px solid var(--text-faint);
}

.issue-card-link {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
  color: inherit;
  text-decoration: none;
}

.issue-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.issue-card-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--radius-xs);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.issue-card.danger .issue-card-mark {
  background: var(--danger-soft);
  color: var(--danger);
}
.issue-card.warning .issue-card-mark {
  background: var(--warning-soft);
  color: var(--warning);
}
.issue-card.neutral .issue-card-mark {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.issue-card-eyebrow {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.issue-card-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.issue-card-count {
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 4px 0;
}

.issue-card.danger .issue-card-count { color: var(--danger); }
.issue-card.warning .issue-card-count { color: var(--warning); }

.issue-card-desc {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  min-height: 36px;
}

.issue-card-cta {
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

.issue-card.is-empty .issue-card-cta {
  color: var(--text-faint);
}

/* -------------------------------------------------------------------------
   表单布局
   ------------------------------------------------------------------------- */
.stack-form {
  display: grid;
  gap: 16px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form.compact .field {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 4px;
  margin: 0;
}

.field > span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.field.wide {
  grid-column: 1 / -1;
}

.field.checkbox-row {
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: 8px;
}

.field.checkbox-row > span {
  order: 1;
  margin: 0;
}

.field.checkbox-row input[type="checkbox"] {
  order: 0;
  width: 16px;
  height: 16px;
}

.permission-module-overview {
  display: grid;
  gap: 14px;
}

.permission-module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-module-tabs .ghost-button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

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

.permission-relationship-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  min-width: 0;
}

.permission-relationship-grid strong {
  color: var(--text);
}

.permission-relationship-grid span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.permission-card-list {
  display: grid;
  gap: 10px;
}

.permission-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.permission-card-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.permission-card-main input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

.permission-card-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.permission-action-name {
  color: var(--text);
  font-weight: 700;
}

.permission-card-text small {
  flex-basis: 100%;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.permission-scope-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.permission-scope-field > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .permission-module-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .permission-module-tabs .ghost-button {
    justify-content: center;
    width: 100%;
  }

  .permission-relationship-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .permission-card {
    grid-template-columns: 1fr;
  }
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.actions button {
  min-width: 88px;
}

.scheduler-task-list {
  display: grid;
  gap: 10px;
}

.scheduler-task-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(220px, 1.4fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.scheduler-task-check {
  align-self: center;
}

.scheduler-task-check > span {
  color: var(--text-main);
  font-weight: 700;
}

.scheduler-task-copy {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.scheduler-task-input {
  min-width: 0;
}

.scheduler-time-field {
  min-width: 0;
  max-width: 260px;
  justify-self: stretch;
}

.scheduler-time-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .scheduler-task-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* -------------------------------------------------------------------------
   Flash 提示
   ------------------------------------------------------------------------- */
.flash-stack {
  display: grid;
  gap: 8px;
  padding: 0 24px;
  margin-top: 12px;
}

.flash {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  font-size: 13px;
  line-height: 1.5;
  animation: flashIn 180ms ease-out;
  transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-content {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.flash.success {
  background: var(--success-soft);
  border-color: rgba(0, 180, 42, 0.2);
  color: #0a6e1c;
}
.flash.success .flash-content { color: #0a6e1c; }

.flash.warning,
.flash.warn {
  background: var(--warning-soft);
  border-color: rgba(255, 125, 0, 0.25);
  color: #a74b00;
}
.flash.warning .flash-content,
.flash.warn .flash-content { color: #a74b00; }

.flash.error,
.flash.danger {
  background: var(--danger-soft);
  border-color: rgba(245, 63, 63, 0.25);
  color: #a31717;
}
.flash.error .flash-content,
.flash.danger .flash-content { color: #a31717; }

.flash.info {
  background: var(--info-soft);
  border-color: rgba(51, 112, 255, 0.2);
  color: var(--brand-strong);
}
.flash.info .flash-content { color: var(--brand-strong); }

.flash-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: currentColor;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  box-shadow: none;
}

.flash-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

/* -------------------------------------------------------------------------
   表格工具条
   ------------------------------------------------------------------------- */
.table-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.table-toolbar > div:first-child {
  min-width: 0;
  flex: 1;
}

.toolbar-note {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 4px;
}

/* -------------------------------------------------------------------------
   登录页
   ------------------------------------------------------------------------- */
body.login-page {
  padding: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(51, 112, 255, 0.12), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(91, 140, 255, 0.08), transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 0;
  width: min(960px, 92vw);
  max-width: 100%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.login-aside {
  position: relative;
  padding: 48px 40px;
  background: linear-gradient(135deg, #3370ff 0%, #5b8cff 60%, #7aa6ff 100%);
  color: #ffffff;
  overflow: hidden;
}

.login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.18), transparent 35%),
    radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.12), transparent 40%);
  pointer-events: none;
}

.login-aside-card {
  position: relative;
  display: grid;
  gap: 14px;
}

.login-aside .eyebrow {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: var(--radius-xs);
}

.login-aside h1 {
  margin: 0;
  color: #ffffff;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.login-aside > .login-aside-card > p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

.login-feature-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.login-feature-item {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
}

.login-feature-item strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.login-feature-item span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.55;
}

.login-card {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface-solid);
}

.login-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3370ff, #5b8cff);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(51, 112, 255, 0.3);
}

.login-card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.login-card-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 2px 0 0;
}

.login-form {
  display: grid;
  gap: 14px;
}

.demo-account-panel {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 12px;
}

.demo-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.demo-account-head strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.demo-account-head span {
  font-size: 12px;
  color: var(--text-muted);
}

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

.demo-account-button {
  min-width: 0;
  height: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: none;
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
}

.demo-account-button span {
  font-size: 11px;
  color: var(--text-muted);
}

.demo-account-button strong {
  font-size: 13px;
  font-weight: 600;
  color: #245bdb;
}

.demo-account-button:hover {
  border-color: rgba(51, 112, 255, 0.36);
  background: rgba(51, 112, 255, 0.06);
}

.login-submit {
  width: 100%;
  height: 36px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
}

.login-anchor-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  border: 1px solid rgba(51, 112, 255, 0.28);
  border-radius: var(--radius-sm);
  color: #245bdb;
  background: rgba(51, 112, 255, 0.06);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.login-anchor-entry:hover {
  background: rgba(51, 112, 255, 0.1);
  border-color: rgba(51, 112, 255, 0.45);
  transform: translateY(-1px);
}

.login-footer-note {
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(420px, 92vw);
  }
  .login-aside {
    padding: 28px 24px;
  }
  .login-card {
    padding: 28px 24px;
  }
  .demo-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .page-actions .ghost-button,
  .page-actions .primary-button,
  .hero-actions .ghost-button,
  .hero-actions .primary-button,
  .quick-actions .ghost-button,
  .quick-actions .primary-button {
    width: 100%;
    min-height: 40px;
  }

  .hero-title {
    font-size: 19px;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-action-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .inline-form,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-wrap {
    overflow: visible;
    border: none;
    background: transparent;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .table-wrap tr {
    padding: 8px 12px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(88px, 36%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 9px 0;
    text-align: right;
    border-bottom: 1px solid var(--border-soft);
    white-space: normal;
    word-break: break-word;
  }

  .table-wrap td:last-child {
    border-bottom: none;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
  }

  .table-wrap td[data-label="操作"] .text-link,
  .table-wrap td[data-label="操作"] .ghost-button,
  .table-wrap td[data-label="操作"] .primary-button {
    justify-self: end;
  }
}

@media (min-width: 961px) and (max-width: 1180px) {
  .page-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .page-heading {
    flex: 1 1 260px;
  }

  .page-toolbar {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-actions {
    flex: 1 1 auto;
  }
}

/* -------------------------------------------------------------------------
   响应式：移动端
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
  }

  .shell.mobile-open .sidebar {
    transform: translateX(0);
  }

  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    border: none;
    padding: 0;
    cursor: pointer;
  }

  .shell.mobile-open .mobile-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .page-header {
    position: static;
    top: auto;
    z-index: 10;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  }

  .page-heading {
    flex: 1 1 calc(100% - 48px);
    min-width: 0;
  }

  .page-toolbar {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .main-inner {
    padding: 12px 16px 24px;
  }

  .flash-stack {
    padding: 0 16px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .sync-form {
    grid-template-columns: 1fr;
  }

  .sync-quick-actions,
  .sync-submit {
    grid-column: 1;
    justify-content: flex-start;
  }

  .header-meta {
    display: flex;
    margin-left: 0;
    gap: 6px;
    padding-right: 0;
    border-right: none;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }

  .header-meta > .chip {
    display: none;
  }

  .header-user-button {
    width: 32px;
    min-width: 32px !important;
    padding: 0 !important;
    justify-content: center;
  }

  .header-user-button .header-user-name,
  .header-user-button > svg {
    display: none;
  }

  .header-logout-button {
    width: 32px;
    min-width: 32px !important;
    padding: 0;
  }

  .header-logout-button span {
    display: none;
  }

  .notification-trigger {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .notification-menu {
    position: fixed;
    top: 56px;
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* -------------------------------------------------------------------------
   一些实用工具类（兼容旧模板）
   ------------------------------------------------------------------------- */
.text-muted { color: var(--text-muted) !important; }
.text-faint { color: var(--text-faint) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }

.hidden { display: none !important; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.check-card strong,
.check-card small {
  display: block;
}

.check-card small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

/* CSRF 错误页 */
.csrf-error {
  max-width: 520px;
  margin: 80px auto;
  padding: 32px 36px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* 打印 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-grid .full,
.field.full {
  grid-column: 1 / -1;
}

.field.inline-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.field.inline-check input {
  width: auto;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.action-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.action-cell form {
  margin: 0;
}

.table-action-tip {
  width: 16px;
  height: 16px;
  font-size: 11px;
}

.anchor-profile-form {
  display: block;
}

.panel-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading-row .btn-secondary {
  flex: 0 0 auto;
}

.anchor-profile-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.anchor-avatar-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 260px;
  padding: 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 10%, rgba(51, 112, 255, 0.1), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-xs);
}

.anchor-avatar-panel-title {
  justify-self: start;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.anchor-avatar-panel .avatar-upload {
  width: auto !important;
  max-width: none !important;
  flex: none;
}

.anchor-avatar-panel .avatar-upload-row {
  width: auto !important;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.anchor-avatar-panel .avatar-upload-copy {
  align-items: center;
  text-align: center;
}

.anchor-avatar-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

.anchor-profile-fields {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.anchor-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px 18px;
}

.anchor-profile-form .field > span,
.anchor-profile-form .toggle-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.anchor-profile-form .field small,
.anchor-profile-form .toggle-copy small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.anchor-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.toggle-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.toggle-card:hover {
  border-color: rgba(51, 112, 255, 0.34);
  background: #fbfdff;
  box-shadow: var(--shadow-xs);
}

.toggle-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-box {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  margin-top: 1px;
  border-radius: 999px;
  background: #d8dee8;
  transition: background var(--transition);
}

.toggle-box::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform var(--transition);
}

.toggle-card input:checked + .toggle-box {
  background: var(--brand);
}

.toggle-card input:checked + .toggle-box::after {
  transform: translateX(16px);
}

.toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.anchor-profile-fields .form-actions {
  justify-content: flex-end;
  padding-top: 2px;
  align-items: center;
  flex-wrap: wrap;
}

.form-editing-hint {
  margin-right: auto;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.anchor-list-table td {
  vertical-align: middle;
}

.anchor-list-table tr.is-editing {
  background: rgba(51, 112, 255, 0.06);
  box-shadow: inset 3px 0 0 var(--primary);
}

.row-edit-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(51, 112, 255, 0.12);
  font-size: 12px;
  font-weight: 600;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 220px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn-secondary:hover {
  border-color: rgba(51, 112, 255, 0.42);
  background: #f6f9ff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.status-pill.muted {
  color: var(--text-muted);
  background: #f2f4f8;
}

@media (max-width: 960px) {
  .anchor-profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .anchor-avatar-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .anchor-field-grid,
  .anchor-toggle-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .sidebar, .page-header, .flash-stack, .page-actions {
    display: none !important;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .panel {
    box-shadow: none;
    border-color: #000;
  }
}

/* =========================================================================
   巨量后台风 · 增量组件
   - filter-bar    标准筛选条（白底，一行排列，主操作右对齐）
   - segmented     连体分段控件（替代多 ghost 按钮拼接）
   - kpi-strip     轻量 KPI 条（用于业务标题下方的统计条）
   - step-mini     横排小步骤卡片（可折叠，企业内部引导）
   - xs-button     表格内 28px 紧凑按钮
   - more-menu     基于 <details> 的"更多▾"下拉
   - status-pill   状态徽章（柔和填充 + 小圆点）
   - page-intro    替代 hero-card 的轻量页面引导块
   ========================================================================= */

/* ---- filter-bar ---------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.filter-bar .field {
  margin: 0;
  min-width: 160px;
}

.filter-bar .field.compact {
  min-width: 130px;
}

/* 直播平台 chip（v1.0 引入；SVG 标识跟随品牌色） */
.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid var(--platform-color, #6b7280);
  border-radius: 3px;
  font-size: 11px;
  color: #1f2937;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  line-height: 1.4;
}
.platform-chip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  color: var(--platform-color, #6b7280);
}
.platform-chip__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.platform-chip__label { font-weight: 500; }
.platform-chip--xs {
  padding: 0 5px;
  font-size: 10px;
}
.platform-chip--xs .platform-chip__icon { width: 10px; height: 10px; }
.platform-chip--lg {
  padding: 3px 9px;
  font-size: 12px;
}
.platform-chip--lg .platform-chip__icon { width: 14px; height: 14px; }

.ops-account-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
}

.ops-account-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f5ff;
  border: 1px solid rgba(51, 112, 255, 0.14);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.ops-account-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3370ff;
  font-size: 14px;
  font-weight: 700;
}

.ops-source-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ops-source-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
}

.ops-source-badge--manual {
  color: #b25b00;
  background: #fff0d9;
}

.ops-source-badge--official {
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.ops-account-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ops-account-main strong {
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-col {
  width: 42px;
  text-align: center;
}

.select-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.select-col input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.ops-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 12px;
  padding: 12px 14px;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f5f8ff;
}

.ops-bulk-copy {
  display: grid;
  gap: 2px;
}

.ops-bulk-copy strong {
  font-size: 14px;
  color: var(--text);
}

.ops-bulk-copy span {
  font-size: 12px;
  color: var(--text-muted);
}

.ops-account-id {
  font-size: 10px;
  color: #9ca3af;
}

/* 筛选提示文字（v1.0 简化） */
.filter-hint {
  margin: 8px 0 0 0;
  padding: 6px 10px;
  background: #f0f9ff;
  border-left: 3px solid #3b82f6;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.6;
}
.filter-hint strong { color: #1e3a8a; }

/* KPI 区拆两行：必处理 / 仅查看（v1.0 简化） */
.kpi-row-label {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: #6b7280;
  margin-right: 4px;
  align-self: center;
  white-space: nowrap;
}
.kpi-actionable .kpi-card { border-left: 3px solid transparent; }
.kpi-actionable .kpi-card.warning { border-left-color: #f59e0b; }
.kpi-actionable .kpi-card.danger { border-left-color: #dc2626; }
.kpi-overview .kpi-card { background: #f9fafb; }
.top-gap-sm { margin-top: 8px; }

.review-workbench-panel {
  margin-bottom: 0;
}

.review-workbench-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.review-workbench-card {
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.review-workbench-card:hover {
  color: var(--text);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.review-workbench-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.review-workbench-card.warning { border-left-color: #f59e0b; }
.review-workbench-card.danger { border-left-color: #dc2626; }
.review-workbench-card.info { border-left-color: #3b82f6; }
.review-workbench-card.success { border-left-color: #16a34a; }

.review-workbench-label,
.review-workbench-meta {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.review-workbench-card strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* 可搜索下拉（用于直播账号筛选） v1.0 引入 */
[x-cloak] { display: none !important; }
.searchable-select { position: relative; min-width: 220px; }
.searchable-select input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 4px;
  font-size: 13px;
}
.searchable-select input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.searchable-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin: 2px 0 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 320px;
  overflow-y: auto;
}
.searchable-dropdown li {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.searchable-dropdown li:hover { background: #eff6ff; }
.searchable-dropdown li.active { background: #dbeafe; font-weight: 600; }
.searchable-dropdown li.empty { color: #9ca3af; font-style: italic; cursor: default; }
.searchable-dropdown li.empty:hover { background: transparent; }

.subject-bind-form {
  align-items: flex-end;
  gap: 12px;
}

.subject-bind-form .field {
  min-width: min(760px, 100%);
}

.subject-advertiser-combobox {
  position: relative;
  width: min(860px, 100%);
}

.subject-advertiser-search {
  width: 100%;
}

.subject-advertiser-dropdown {
  max-height: 300px;
}

.subject-advertiser-dropdown li {
  display: grid;
  gap: 2px;
}

.subject-advertiser-dropdown li small {
  color: var(--text-muted);
  font-size: 12px;
}

.filter-bar .filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.filter-bar .toolbar-note {
  flex-basis: 100%;
  margin-top: 0;
  color: var(--text-faint);
}

/* ---- segmented control --------------------------------------------------- */
.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 0;
}

.segmented > a,
.segmented > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 56px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  box-shadow: none;
}

.segmented > a:hover,
.segmented > button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

.segmented > a.active,
.segmented > button.active,
.segmented > a[aria-current="page"] {
  background: var(--surface-solid);
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}

/* ---- kpi-strip ----------------------------------------------------------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}

.kpi-card:hover {
  border-color: var(--border-strong);
}

.kpi-card .kpi-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.kpi-card .kpi-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi-card .kpi-meta {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.4;
}

/* ---- step-mini ----------------------------------------------------------- */
.step-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.step-mini-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition);
}

.step-mini-card:hover {
  color: var(--text);
  border-color: var(--brand);
}

.step-mini-card .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.step-mini-card .step-body strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-mini-card .step-body span {
  display: block;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.4;
}

.step-mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  height: auto;
  min-width: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.step-mini-toggle:hover {
  background: transparent;
  border: none;
  color: var(--brand);
}

.step-mini-toggle::after {
  content: "▾";
  display: inline-block;
  transition: transform var(--transition);
  font-size: 10px;
}

.step-mini-toggle[aria-expanded="false"]::after {
  transform: rotate(-90deg);
}

.step-mini[hidden] {
  display: none;
}

/* ---- xs-button (table row 紧凑按钮) -------------------------------------- */
.xs-button,
button.xs-button,
a.xs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: auto;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: none;
}

.xs-button:hover,
a.xs-button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--surface-solid);
}

.xs-button.danger {
  color: var(--danger);
}

.xs-button.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.xs-button.disabled,
span.xs-button.disabled {
  color: var(--text-muted);
  background: #f8fafc;
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.62;
}

/* ---- more-menu (基于 details) -------------------------------------------- */
.more-menu {
  position: relative;
  display: inline-block;
}

.more-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: all var(--transition);
}

.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary::after {
  content: "▾";
  font-size: 9px;
  margin-left: 2px;
  opacity: 0.7;
}

.more-menu > summary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.more-menu[open] > summary {
  border-color: var(--brand);
  color: var(--brand);
}

.more-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 144px;
  padding: 4px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  display: grid;
  gap: 2px;
}

.more-menu-panel a,
.more-menu-panel button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  justify-content: flex-start;
  min-width: auto;
  box-shadow: none;
}

.more-menu-panel a:hover,
.more-menu-panel button:hover {
  background: var(--surface-hover);
  color: var(--brand);
  border: none;
}

.more-menu-panel form {
  margin: 0;
}

/* ---- status-pill (柔和填充 + 圆点) --------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.status-pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.info {
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---- page-intro (轻量页面引导，替代 hero-card) --------------------------- */
.page-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.page-intro-copy {
  flex: 1;
  min-width: 240px;
}

.page-intro-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.page-intro-copy span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-intro-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---- 表格内的 entity-cell 紧凑变体 --------------------------------------- */
.row-actions.compact {
  gap: 6px;
  min-width: auto;
  flex-wrap: nowrap;
}

.attribution-editor {
  position: relative;
}

.attribution-editor[open] {
  z-index: 3;
}

.attribution-editor summary {
  list-style: none;
}

.attribution-editor summary::-webkit-details-marker {
  display: none;
}

.compact-form {
  display: grid;
  gap: 8px;
  min-width: 240px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
}

.compact-form label {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.compact-form select,
.compact-form input {
  width: 100%;
  min-width: 0;
}

/* ---- 表格行 hover 加强 -------------------------------------------------- */
.table-wrap table tbody tr:hover td {
  background: #fafbfc;
}

/* ---- 响应式补丁 --------------------------------------------------------- */
@media (max-width: 720px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .filter-actions {
    margin-left: 0;
    justify-content: flex-end;
  }
  .filter-bar .field,
  .filter-bar .field.compact {
    min-width: 0;
    width: 100%;
  }
  .step-mini {
    grid-template-columns: 1fr;
  }
}

/* ---- 官方开播数据工作台 ---------------------------------------------------- */
.sync-toolbar {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: #f8fafc;
}

.view-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.view-toggle a.active {
  color: #1d4ed8;
  background: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.live-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.live-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.live-card__header,
.live-card__actions,
.live-card__attribution {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.live-card__title {
  min-width: 0;
}

.live-card__title strong {
  display: block;
  max-width: 420px;
  overflow: hidden;
  color: #0f172a;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-card__title span,
.live-card__time span,
.metric-row span,
.metric-summary-card span {
  color: #64748b;
  font-size: 12px;
}

.live-card__time {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.live-card__time div,
.metric-row,
.metric-summary-card {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
}

.live-card__time strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 15px;
  white-space: nowrap;
}

.live-card__attribution {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 12px;
  border-radius: 16px;
  background: #f8fbff;
}

.live-card__attribution > div {
  min-width: 140px;
}

.live-card__attribution strong {
  display: block;
  color: #0f172a;
}

.live-card__anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-card__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-row strong {
  display: block;
  margin: 6px 0 2px;
  color: #0f172a;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.metric-row small {
  color: #94a3b8;
  font-size: 11px;
}

.metric-row--not_synced strong,
.metric-row--missing strong,
.metric-row--unit_pending strong,
.metric-row--permission_denied strong,
.metric-row--token_expired strong,
.metric-row--error strong {
  color: #94a3b8;
  font-size: 16px;
}

.metric-row--permission_denied,
.metric-row--token_expired,
.metric-row--error {
  background: #fff1f2;
}

.metric-row--unit_pending {
  background: #fffbeb;
}

.attribution-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.metrics-workbench {
  display: grid;
  gap: 16px;
}

.metric-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-summary-card {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.metric-summary-card strong {
  display: block;
  margin: 8px 0;
  color: #0f172a;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.metric-summary-card small {
  color: #64748b;
}

.ellipsis-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-live-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.official-live-table th,
.official-live-table td {
  vertical-align: middle;
}

.official-live-table .num-cell {
  min-width: 108px;
}

@media (max-width: 1180px) {
  .live-card-grid,
  .metric-summary-grid {
    grid-template-columns: 1fr;
  }

  .live-card__metrics,
  .live-card__time {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .view-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .view-toggle a {
    flex: 1;
    padding: 0 8px;
  }

  .live-card__header,
  .live-card__actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

.official-business-panel,
.official-live-table-wrap,
.metrics-workbench {
  max-width: 100%;
}

.official-kpi-strip {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.official-live-filter {
  align-items: end;
  gap: 12px;
}

.live-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
}

.live-card--compact {
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
}

.live-card--compact .live-card__header {
  gap: 10px;
}

.live-card--compact .avatar-upload.avatar-upload--md .avatar-upload__trigger,
.live-card--compact .avatar-upload.avatar-upload--md .avatar-upload__image,
.live-card--compact .avatar-upload.avatar-upload--md .avatar-upload__placeholder {
  width: 42px;
  height: 42px;
  min-width: 42px;
}

.live-card--compact .live-card__title strong {
  display: block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-card--compact .live-card__time {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.live-card--compact .live-card__time div,
.live-card--compact .metric-row {
  min-width: 0;
  padding: 7px 8px;
}

.live-card--compact .live-card__metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.live-card--compact .metric-row strong {
  font-size: 1rem;
}

.live-card--compact .live-card__actions {
  gap: 6px;
}

.live-card-detail {
  display: grid;
  gap: 12px;
  max-width: min(760px, calc(100vw - 64px));
  padding: 10px 0 4px;
}

.live-card-detail section {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.live-card-detail h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.metric-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.metric-detail-grid > div {
  min-width: 0;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}

.metric-detail-grid span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  margin-bottom: 3px;
}

.metric-detail-grid strong {
  overflow-wrap: anywhere;
}

.official-session-detail {
  max-width: 1180px;
  margin: 0 auto;
}

.official-session-detail .live-card-detail {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.diagnostic-json {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  max-height: 360px;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .live-card--compact .live-card__time,
  .live-card--compact .live-card__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.business-id {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.qianchuan-source-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.qianchuan-source-list li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 12px;
  background: var(--surface-muted, #f8fafc);
}

.qianchuan-source-list li span,
.qianchuan-source-list li em {
  color: var(--text-muted, #64748b);
  font-size: 12px;
  font-style: normal;
}

.live-card__source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px dashed var(--border-subtle, #e5e7eb);
  border-bottom: 1px dashed var(--border-subtle, #e5e7eb);
}

.live-card__source > div {
  min-width: 0;
}

.live-card__source span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.live-card__source strong {
  display: block;
  line-height: 1.45;
}

.live-card__source details {
  grid-column: 1 / -1;
}

.live-card__metric-empty {
  grid-column: 1 / -1;
}

.sync-form {
  align-items: stretch;
}

.sync-form__section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 16px;
  background: var(--surface, #fff);
}

.sync-form__section-title {
  grid-column: 1 / -1;
  font-weight: 700;
  color: var(--text-strong, #111827);
}

.sync-form__section--actions {
  grid-template-columns: 1fr;
}

.sync-action-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
}

.sync-submit--split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sync-submit--split button {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .live-card__source {
    grid-template-columns: 1fr;
  }

  .sync-form__section {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   千川数据中控台 v2 — 同步工作区 / 候选千川户 / 场次卡片
   ============================================================ */

[x-cloak] { display: none !important; }

.full-width { width: 100%; }

.sync-workspace .workspace-step {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed #eee;
}
.sync-workspace .workspace-step:last-child { border-bottom: none; }

.workspace-step .step-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.workspace-step .step-header .step-num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: #1e88e5;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
}
.workspace-step .step-header strong {
  font-size: 15px;
  color: #222;
}
.workspace-step .step-header .step-hint {
  color: #666;
  font-size: 12px;
}
.workspace-step .step-body { min-width: 0; }

.candidate-panel {
  background: #f5f9ff;
  border: 1px solid #d6e4f5;
  border-radius: 6px;
  padding: 12px 16px;
}
.candidate-panel__title {
  margin-bottom: 10px;
  color: #333;
  font-size: 13px;
}
.candidate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.candidate-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.candidate-item label:hover { border-color: #1e88e5; }
.candidate-item.is-selected label {
  border-color: #1e88e5;
  background: #e3f2fd;
}
.candidate-item input[type="radio"] { margin-top: 4px; flex-shrink: 0; }
.candidate-meta { flex: 1; min-width: 0; }
.candidate-meta .business-id {
  margin-left: 8px;
  font-family: monospace;
  font-size: 11px;
  color: #666;
}
.candidate-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.candidate-tags .role-chip {
  font-size: 11px;
  padding: 2px 8px;
  background: #f0f0f0;
  color: #555;
  border-radius: 3px;
  white-space: nowrap;
}

.time-range-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.time-range-row .field { flex: 1; min-width: 200px; }

.time-quick-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.sync-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sync-action-row button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-pills-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 场次卡片 ===== */

.session-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}

.session-card {
  background: white;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-card__header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.session-card__title { flex: 1; min-width: 0; }
.session-card__title strong {
  display: block;
  font-size: 15px;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-card__sub {
  margin: 4px 0 0 0;
  color: #666;
  font-size: 12px;
}

.session-card__times,
.session-card__attribution {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px 12px;
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}
.session-card__times > div,
.session-card__attribution > div {
  display: flex;
  flex-direction: column;
}
.session-card__times span,
.session-card__attribution span {
  color: #888;
  font-size: 11px;
}
.session-card__times strong,
.session-card__attribution strong {
  color: #222;
  font-size: 13px;
  font-weight: 500;
}

.session-card__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}
.session-card__metrics .metric-row {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  background: #fafafa;
  border-radius: 4px;
  font-size: 12px;
}
.session-card__metrics .metric-row span { color: #888; font-size: 11px; }
.session-card__metrics .metric-row strong { font-size: 14px; color: #222; }
.session-card__metrics .metric-row small { color: #aaa; font-size: 10px; }
.session-card__metrics .metric-row--value { background: #f0f9ff; border-color: #bbdefb; }
.session-card__metrics .metric-row--value small { color: #1a73e8; }
.session-card__sync-time {
  font-size: 11px;
  color: #5f6368;
  padding: 4px 8px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-top: 6px;
  display: inline-block;
}

/* ===== 详情页：业务 ID 行、改归属、诊断矩阵、扩展数据 ===== */

.biz-id-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}

.reattribution-section {
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 12px 16px;
  background: #fffdf6;
}
.reattribution-summary {
  cursor: pointer;
  font-weight: 600;
  color: #e65100;
  list-style: none;
  user-select: none;
}
.reattribution-summary::-webkit-details-marker { display: none; }

/* 归属变更历史列表（详情页） */
.attribution-history-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.attribution-history-item {
  border-left: 3px solid #ffb74d;
  padding: 8px 12px;
  background: #fff;
  border-radius: 0 4px 4px 0;
}
.attribution-history-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}
.attribution-history-head strong {
  color: #333;
}
.attribution-history-body {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
}
.attribution-history-body .muted-small {
  font-size: 11px;
  color: #888;
}
.attribution-history-reason {
  margin-top: 4px;
  padding: 4px 8px;
  background: #fff8e1;
  border-radius: 3px;
  color: #5d4037;
  font-size: 12px;
}
.tag-warning {
  display: inline-block;
  padding: 1px 6px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 3px;
  font-size: 11px;
}

/* 同步诊断矩阵 */
.diagnostic-matrix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.diagnostic-row {
  display: grid;
  grid-template-columns: 200px 200px 80px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  background: #fafafa;
  border-left: 3px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}
.diagnostic-row--success { border-left-color: #43a047; background: #f1f8e9; }
.diagnostic-row--permission_denied { border-left-color: #c62828; background: #ffebee; }
.diagnostic-row--token_expired { border-left-color: #ef6c00; background: #fff3e0; }
.diagnostic-row--rate_limited { border-left-color: #ef6c00; background: #fff3e0; }
.diagnostic-row--failed { border-left-color: #c62828; background: #ffebee; }
.diagnostic-row--not_synced { border-left-color: #9e9e9e; }

.diagnostic-label strong { display: block; }
.diagnostic-label code { font-size: 10px; color: #666; word-break: break-all; }
.diagnostic-status { display: flex; flex-direction: column; gap: 4px; }
.diagnostic-status small { color: #666; font-size: 11px; }
.diagnostic-action { text-align: right; }
.diagnostic-next { color: #555; font-size: 12px; }
.diagnostic-raw { margin-top: 6px; }
.diagnostic-raw summary { cursor: pointer; font-size: 11px; color: #c62828; list-style: none; user-select: none; }
.diagnostic-raw summary::-webkit-details-marker { display: none; }
.diagnostic-raw code {
  display: block;
  margin-top: 4px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #ffcdd2;
  border-radius: 3px;
  font-size: 11px;
  word-break: break-all;
  color: #5d4037;
}

/* 扩展数据按维度分组 */
.dimension-block {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px 12px;
}
.dimension-block summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dimension-block summary::-webkit-details-marker { display: none; }
.dimension-block .dim-count {
  background: #eef2f7;
  color: #555;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11px;
}
.dimension-block summary::before {
  content: '▶ ';
  font-size: 10px;
  color: #888;
  margin-right: 6px;
}
.dimension-block[open] summary::before {
  content: '▼ ';
}

.diagnostic-json {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: 'SF Mono', Consolas, Menlo, monospace;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 760px) {
  .diagnostic-row {
    grid-template-columns: 1fr;
  }
}

.session-card__error {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
}
.session-card__error > summary {
  cursor: pointer;
  color: #e65100;
  font-weight: 500;
  list-style: none;
  user-select: none;
}
.session-card__error > summary::-webkit-details-marker { display: none; }
.session-card__error > summary::before {
  content: '▶ ';
  font-size: 10px;
  margin-right: 4px;
  color: #e65100;
}
.session-card__error[open] > summary::before {
  content: '▼ ';
}
.session-card__error .error-msg {
  margin: 6px 0 0 0;
  color: #5d4037;
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
}

.session-card__footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.session-card__ids {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
}
.business-id-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: #f5f5f5;
  font-size: 11px;
  color: #666;
  border-radius: 3px;
}
.business-id-tag code {
  background: transparent;
  font-family: monospace;
  color: #333;
  padding: 0;
}

/* 紧凑业务 ID：浅色标签 + 等宽 ID */
.biz-id {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px 1px 0;
  font-size: 11px;
  white-space: nowrap;
}
.biz-id em {
  display: inline-block;
  padding: 1px 5px;
  background: #eef2f7;
  color: #6b7280;
  font-style: normal;
  font-weight: 500;
  border-radius: 3px;
  line-height: 1.4;
}
.biz-id code {
  background: transparent;
  color: #1f2937;
  font-family: 'SF Mono', Consolas, Menlo, monospace;
  font-size: 11px;
  padding: 0;
  user-select: all;
}

/* ===== 折叠面板：高级操作 / 诊断 ===== */

.advanced-ops > summary,
.diagnostics-panel > summary {
  cursor: pointer;
  padding: 12px 16px;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  list-style: none;
  user-select: none;
  font-size: 14px;
}
.advanced-ops > summary::before,
.diagnostics-panel > summary::before {
  content: '▶ ';
  color: #888;
  font-size: 11px;
  margin-right: 6px;
}
.advanced-ops[open] > summary::before,
.diagnostics-panel[open] > summary::before {
  content: '▼ ';
}

/* "更多筛选" 折叠在主筛选条里的样式 */
.filter-more {
  width: 100%;             /* 强制独占一行，不被 flex 挤变形 */
  margin-top: 4px;
}
.filter-more > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 13px;
  color: #1e88e5;
  padding: 4px 0;
  display: inline-block;
}
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more > summary::marker { content: ''; }   /* 现代浏览器隐藏默认三角 */
.filter-more > summary::before {
  content: '▶ ';
  color: #888;
  font-size: 11px;
  margin-right: 4px;
}
.filter-more[open] > summary::before { content: '▼ '; }
.filter-more-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  align-items: end;
}
.filter-more-body label.field {
  flex: 0 0 auto;
}

/* 工具栏里的紧凑下拉、批量同步表单 */
.compact-select {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-right: 4px;
}
.batch-sync-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.batch-sync-form .batch-range-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.batch-custom-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.batch-custom-range[hidden] {
  display: none !important;
}
.batch-sync-form .batch-label {
  font-size: 12px;
  color: #5f6368;
  white-space: nowrap;
}
.batch-sync-form .batch-sep {
  font-size: 12px;
  color: #888;
  padding: 0 2px;
}
.batch-sync-form input[type="date"] {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 140px;
  max-width: 140px;
  background: #fff;
}
.sync-progress {
  width: 110px;
  height: 8px;
  border-radius: 999px;
  background: #edf1f7;
  overflow: hidden;
  margin-bottom: 4px;
}
.sync-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f7cff, #18b7a7);
  transition: width 0.25s ease;
}

/* 新工具栏：紧凑三行布局 */
.ops-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 12px 0;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 12px;
  gap: 16px;
}
.ops-toolbar-title strong {
  font-size: 15px;
  color: #222;
}
.ops-toolbar-title small {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}
.ops-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 紧凑视图切换：取消大椭圆 */
.view-toggle.compact-toggle {
  padding: 2px;
  border-radius: 6px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
}
.view-toggle.compact-toggle a {
  min-height: 26px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}
.view-toggle.compact-toggle a.active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  background: #fff;
}

/* 主筛选条：去掉背景框 */
.ops-filter-row {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 8px;
  row-gap: 8px;
}

/* 主筛选条字段：比通用 filter-bar 略窄，让 1280-1366 屏可一行容下 6 个 field */
.ops-filter-row .field { min-width: 140px; }
.ops-filter-row .field.compact { min-width: 120px; }
.ops-filter-row .searchable-select { min-width: 180px; }
.ops-filter-row .filter-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

/* 卡片底部 attribution 候选户的"详情页查看清单"次行 hint */
.session-card__attribution small.muted-small {
  margin-top: 2px;
  font-size: 11px;
  color: #9aa0a6;
  font-weight: 400;
}

/* 详情页：业务区"关联千川户"表格 —— "本场来源"高亮行 + 等宽 advertiser_id */
.candidate-table tr.is-current td {
  background: #e3f2fd;
}
.candidate-table tr.is-current td:first-child {
  border-left: 3px solid #1a73e8;
}
.candidate-table code {
  font-family: 'SF Mono', Consolas, Menlo, monospace;
  font-size: 12px;
  color: #1f2937;
  background: transparent;
  padding: 0;
  user-select: all;
}
.candidate-table th { white-space: nowrap; }

/* panel-title 旁边的小注：候选 N 个 · 来源 */
.panel-title small.muted-small {
  margin-left: 8px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

/* operations_anchors / 详情页：表单字段下方的辅助说明 small.muted-small */
.field > small.muted-small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.5;
}
.field > small.muted-small strong { color: #4E5969; }

/* 操作按钮行 */
.ops-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  margin-top: 4px;
}

/* 诊断矩阵：无独立刷新入口的提示 */
.diagnostic-hint {
  font-size: 11px;
  color: #9aa0a6;
  font-style: italic;
}

/* 顶部页面操作下拉菜单 */
.action-dropdown {
  position: relative;
  display: inline-block;
}
.action-dropdown > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.action-dropdown > summary::-webkit-details-marker { display: none; }
.action-dropdown > summary::marker { content: ''; }
.action-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 6px 0;
  z-index: 100;
}
.action-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
}
.action-dropdown-menu a:hover {
  background: #f5f5f5;
  color: #1a73e8;
}

/* 分页控件 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  margin-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.pagination .page-link {
  padding: 6px 12px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  color: #1a73e8;
  text-decoration: none;
  font-size: 13px;
  background: #fff;
}
.pagination .page-link:hover {
  background: #f5f5f5;
}
.pagination .page-link.disabled {
  color: #bbb;
  pointer-events: none;
  background: #f8f9fa;
}
.pagination .page-info {
  font-size: 13px;
  color: #5f6368;
  padding: 0 8px;
}

.pagination.mini-pagination {
  display: inline-flex;
  padding: 0;
  margin: 0;
  border-top: 0;
  gap: 4px;
}

.pagination.mini-pagination .page-link {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination .page-link.current {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  pointer-events: none;
}

.ops-pagination-block {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px 0 4px;
  border-top: 1px solid var(--border-subtle, #edf2f7);
}

.ops-pagination-summary {
  justify-self: start;
}

.ops-pagination-controls {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ops-pagination-size {
  justify-self: end;
}

.ops-pagination-size .inline-form {
  align-items: center;
}

.ops-pagination-size .pagination-size-field {
  min-width: 128px;
  margin: 0;
}

@media (max-width: 900px) {
  .ops-pagination-block {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .ops-pagination-summary,
  .ops-pagination-controls,
  .ops-pagination-size {
    justify-self: center;
  }
}

.sub-title {
  font-size: 14px;
  color: #333;
  margin: 16px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

.text-link {
  color: #1e88e5;
  text-decoration: underline;
  font-weight: 500;
}
.text-link:hover { color: #1565c0; }

.empty-hint {
  padding: 24px;
  text-align: center;
  color: #888;
  background: #fafafa;
  border-radius: 6px;
}

.muted-small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ============================================================
   页面说明折叠（低调不抢眼，hover 才感知）
   ============================================================ */
.page-help-block {
  margin-bottom: 12px;
}
.page-help-block > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 12px;
  color: #9ca3af;
  padding: 6px 12px;
  background: transparent;
  border: 1px dashed #e5e7eb;
  border-radius: 6px;
  transition: all 0.15s;
  display: inline-block;
}
.page-help-block > summary::-webkit-details-marker { display: none; }
.page-help-block > summary::marker { content: ''; }
.page-help-block > summary:hover {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}
.page-help-block[open] > summary {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
  margin-bottom: 8px;
}
.page-help-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
}
.page-help-content p { margin: 0 0 8px 0; }
.page-help-content p strong { color: #0f172a; }
.page-help-list {
  margin: 4px 0 12px 0;
  padding-left: 22px;
}
.page-help-list li { margin-bottom: 4px; }
.page-help-list li strong { color: #0f172a; }
.page-help-list li em { color: #dc2626; font-style: normal; font-weight: 500; }
.page-help-content code {
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 12px;
  color: #475569;
}
.page-help-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  margin-top: 12px !important;
}

/* ============================================================
   消息中心
   ============================================================ */
.notification-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}

.notification-tab strong {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.notification-tab:hover,
.notification-tab.active {
  color: var(--brand);
  border-color: rgba(51, 112, 255, 0.3);
  background: var(--brand-soft);
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
}

.notification-row.is-unread {
  border-color: rgba(51, 112, 255, 0.32);
  background: rgba(51, 112, 255, 0.05);
}

.notification-row.priority-critical {
  border-left: 3px solid var(--danger);
}

.notification-row.priority-high {
  border-left: 3px solid var(--warning);
}

.notification-row__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.notification-row__body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.notification-row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notification-row__head strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.notification-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--text-faint);
  font-size: 12px;
}

.notification-row__body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.notification-row__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-row__actions form {
  margin: 0;
}

.notification-unread-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.16);
}

@media (max-width: 760px) {
  .notification-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .notification-row__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* ============================================================
   千川授权用户：紧凑卡片网格
   ============================================================ */
.auth-kpi-panel { padding: 16px; }
.auth-kpi-strip { gap: 10px; }
.auth-kpi-strip .kpi-card { padding: 10px 14px; min-width: 100px; }
.auth-kpi-strip .kpi-card.success { background: #ecfdf5; border-color: #a7f3d0; }
.auth-kpi-strip .kpi-card.danger { background: #fef2f2; border-color: #fecaca; }
.auth-kpi-strip .kpi-card.success .kpi-value { color: #047857; }
.auth-kpi-strip .kpi-card.danger .kpi-value { color: #dc2626; }
.auth-help { margin-top: 12px; }
.auth-help summary {
  cursor: pointer;
  font-size: 13px;
  color: #1d4ed8;
  list-style: none;
  user-select: none;
}
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help summary::before { content: '▶ '; color: #888; font-size: 11px; margin-right: 4px; }
.auth-help[open] summary::before { content: '▼ '; }
.auth-help p { margin: 8px 0 0 0; }

/* 状态色点：替代大块 status-pill */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  vertical-align: middle;
}
.status-dot--success { background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18); }
.status-dot--info    { background: #3b82f6; }
.status-dot--warning { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18); }
.status-dot--danger  { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18); }
.status-dot--muted   { background: #94a3b8; }

/* 卡片网格：响应式 — 桌面 4-5 列、平板 2-3、手机 1 */
.auth-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

/* 单卡片 */
.auth-user-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.15s;
}
.auth-user-card:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
.auth-user-card--success { border-left: 3px solid #10b981; }
.auth-user-card--danger { border-left: 3px solid #ef4444; }
.auth-user-card--warning { border-left: 3px solid #f59e0b; }
.auth-user-card--muted { border-left: 3px solid #cbd5e1; }

/* 卡片头 */
.auc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 10px;
}
.auc-id { display: flex; align-items: center; gap: 8px; }
.auc-id strong { font-size: 14px; color: #111827; }
.auc-status-text { font-size: 12px; color: #6b7280; }

.auc-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.auc-note--empty {
  border-color: #fed7aa;
  background: #fff7ed;
}
.auc-note__display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.45;
}
.auc-note--empty .auc-note__display { color: #9a3412; }
.auc-note__label {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}
.auc-note--empty .auc-note__label {
  background: #ffedd5;
  color: #c2410c;
}
.auc-note__display strong {
  font-size: 14px;
  color: inherit;
}
.auc-note__display span:not(.auc-note__label) {
  color: #9a3412;
  font-size: 12px;
}
.auc-note__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.auc-note__form input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
  background: #fff;
}
.auc-note__form .xs-button { white-space: nowrap; }

/* 卡片主体 3 行指标 */
.auc-body { display: flex; flex-direction: column; gap: 6px; }
.auc-health {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  background: #f8fafc;
  color: #475569;
}
.auc-health strong { color: #1f2937; font-size: 12px; }
.auc-health--success { background: #ecfdf5; color: #047857; }
.auc-health--success strong { color: #047857; }
.auc-health--warning { background: #fffbeb; color: #92400e; }
.auc-health--warning strong { color: #92400e; }
.auc-health--danger { background: #fef2f2; color: #b91c1c; }
.auc-health--danger strong { color: #b91c1c; }
.auc-health--muted { background: #f1f5f9; color: #64748b; }
.auc-health--muted strong { color: #475569; }
.auc-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}
.auc-row-label { color: #6b7280; font-size: 12px; }
.auc-row-value { color: #111827; font-weight: 600; }
.auc-row-extra { color: #9ca3af; font-size: 11px; }
.auc-token--success { color: #047857; }
.auc-token--danger { color: #dc2626; }
.auc-token--warning { color: #b45309; }

.auc-error {
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 2px solid #ef4444;
}

/* 折叠：账号明细 */
.auc-detail {
  border-top: 1px solid #f3f4f6;
  padding-top: 8px;
}
.auc-detail summary {
  cursor: pointer;
  font-size: 12px;
  color: #1d4ed8;
  list-style: none;
  user-select: none;
  padding: 4px 0;
}
.auc-detail summary::-webkit-details-marker { display: none; }
.auc-detail summary::before { content: '▶ '; color: #9ca3af; font-size: 10px; margin-right: 3px; }
.auc-detail[open] summary::before { content: '▼ '; }
.auc-account-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}
.auc-account-item {
  padding: 8px;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}
.auc-account-name { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.auc-account-name strong { color: #111827; font-size: 13px; }
.auc-account-role {
  font-size: 10px;
  padding: 1px 6px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 3px;
}
.auc-account-meta { display: flex; align-items: center; gap: 4px; color: #6b7280; font-size: 11px; }
.auc-account-meta code { background: #f3f4f6; padding: 1px 4px; border-radius: 3px; font-family: monospace; }

/* 账号明细完整字段（codex P2 #4 修复） */
.auc-account-item--full { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
.auc-account-item--full:last-child { border-bottom: none; }
.auc-account-status-text { font-size: 11px; color: #6b7280; margin-left: auto; }
.auc-account-covered {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 10px;
  white-space: nowrap;
}
.auc-account-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 12px;
  margin: 6px 0 0 0;
  padding: 0;
}
.auc-account-field { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.auc-account-field dt { color: #6b7280; font-size: 11px; flex-shrink: 0; min-width: 70px; margin: 0; }
.auc-account-field dd { color: #1f2937; font-size: 12px; margin: 0; word-break: break-all; min-width: 0; }
.auc-account-field code { background: #f3f4f6; padding: 1px 4px; border-radius: 3px; font-family: monospace; font-size: 11px; }

/* 卡片底 */
.auc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}
.auc-foot .xs-button { padding: 4px 12px; font-size: 12px; }
.auc-foot .xs-button.primary { background: #3b82f6; color: #fff; }
.auc-foot .xs-button.primary:hover { background: #2563eb; }
.auc-uid {
  margin-left: auto;
  font-family: monospace;
  font-size: 10px;
  color: #9ca3af;
  cursor: help;
}

@media (max-width: 760px) {
  .auc-note__form {
    grid-template-columns: 1fr;
  }
  .sync-workspace .workspace-step {
    grid-template-columns: 1fr;
  }
  .session-cards {
    grid-template-columns: 1fr;
  }
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d9dde7;
  border-radius: 6px;
  background: #fff;
  color: #4e5969;
  text-decoration: none;
  font-size: 13px;
}
.filter-tab.active {
  color: #245bdb;
  border-color: #3370ff;
  background: #ebf0ff;
  font-weight: 700;
}
.approval-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
}
.approval-user-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}
.approval-user-option small {
  display: block;
  margin-top: 2px;
  color: #86909c;
  font-size: 11px;
}
.approval-status--pending { background: #fff7e8; color: #b7791f; border-color: #fbd38d; }
.approval-status--executed { background: #e8fff3; color: #087443; border-color: #8ee5b7; }
.approval-status--rejected,
.approval-status--failed { background: #fff1f0; color: #c02727; border-color: #ffb3ad; }
.approval-status--expired { background: #f2f3f5; color: #4e5969; border-color: #d9dde7; }
.approval-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.field-label {
  display: block;
  color: #86909c;
  font-size: 12px;
  margin-bottom: 2px;
}
.approval-action-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr);
  gap: 16px;
}
.approval-action-grid textarea {
  width: 100%;
}
.danger-text {
  color: #c02727;
}
.warning-text {
  color: #b45309;
  font-weight: 600;
}

.field-title-with-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.info-tip__bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 80;
  display: none;
  width: min(320px, 72vw);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
  text-align: left;
  box-shadow: var(--shadow-lg);
}

.info-tip__bubble::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: #111827;
}

.info-tip:hover .info-tip__bubble,
.info-tip:focus .info-tip__bubble {
  display: block;
}

.temp-rate-field {
  position: relative;
}

.temp-rate-warning {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

/* Cost / profit coverage selectors */
.coverage-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}
.coverage-toolbar strong {
  color: var(--text);
  font-size: 14px;
  margin-right: auto;
}
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 8px;
  background: var(--surface-muted);
}
.coverage-card {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
.coverage-card[hidden] {
  display: none !important;
}
.coverage-card:hover {
  border-color: rgba(51, 112, 255, 0.35);
  background: rgba(51, 112, 255, 0.04);
}
.coverage-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2ff;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.coverage-card__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.coverage-card__body strong,
.coverage-card__body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coverage-card__body small {
  color: var(--text-muted);
  font-size: 12px;
}
.coverage-card__body .warning-text {
  color: #b45309;
}
@media (max-width: 760px) {
  .approval-action-grid {
    grid-template-columns: 1fr;
  }
  .coverage-grid {
    grid-template-columns: 1fr;
  }
  .coverage-search {
    flex-basis: 100%;
    width: 100%;
  }
}

/* -------------------------------------------------------------------------
   inline-help — 行内字段说明（基于原生 <details>，CSS 失效也不裸奔）
   用法：
     <details class="inline-help">
       <summary aria-label="...">{SVG i 图标}</summary>
       <div class="inline-help__body">说明文字</div>
     </details>
   ------------------------------------------------------------------------- */
.inline-help {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
}
.inline-help > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-soft, #e8efff);
  color: var(--brand, #2e6cef);
  cursor: help;
  list-style: none;
  user-select: none;
  outline: none;
}
.inline-help > summary::-webkit-details-marker { display: none; }
.inline-help > summary::marker { content: ""; }
.inline-help[open] > summary,
.inline-help:hover > summary,
.inline-help:focus-within > summary {
  background: var(--brand, #2e6cef);
  color: #fff;
}
.inline-help > summary:focus-visible {
  outline: 2px solid var(--brand-ring, #93c5fd);
  outline-offset: 2px;
}
.inline-help__body {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.inline-help__body::before {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 100%;
  border: 6px solid transparent;
  border-bottom-color: #111827;
}

/* -------------------------------------------------------------------------
   coverage-search — coverage-toolbar 内的搜索框 + 计数器
   ------------------------------------------------------------------------- */
.coverage-search {
  flex: 0 0 220px;
  width: 220px;
  min-width: 0;
  max-width: 100%;
  height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--border, #d4d8e0);
  border-radius: var(--radius-sm, 4px);
  font-size: 13px;
  background: #fff;
  color: var(--text, #1f2937);
}
.coverage-search:focus {
  outline: none;
  border-color: var(--brand, #2e6cef);
  box-shadow: 0 0 0 2px var(--brand-soft, rgba(46, 108, 239, 0.15));
}
.coverage-counter {
  color: var(--text-muted, #6b7280);
  font-size: 12px;
  white-space: nowrap;
}

/* 开播记录编辑页：单条记录操作时间线 */
.ops-workflow-history {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.ops-workflow-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
}
.ops-workflow-dot {
  width: 10px;
  height: 10px;
  margin: 10px 0 0 4px;
  border-radius: 999px;
  background: var(--brand, #2e6cef);
  box-shadow: 0 0 0 4px rgba(46, 108, 239, 0.12);
}
.ops-workflow-card {
  border: 1px solid var(--border-soft, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}
.ops-workflow-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--text-muted, #6b7280);
  font-size: 12px;
}
.ops-workflow-head strong {
  color: var(--text, #111827);
  font-size: 14px;
}
.ops-workflow-body {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--text, #111827);
  font-size: 13px;
  line-height: 1.6;
}
.ops-workflow-status {
  color: #1d4ed8;
}
.ops-workflow-note {
  padding: 6px 8px;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
}
.ops-workflow-rate {
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
}
.ops-workflow-rate span {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}
.ops-edited-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 2px 7px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.ops-edited-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 999px;
  background: #f59e0b;
}

/* -------------------------------------------------------------------------
   transfer-dialog — 更换主播弹窗（基于原生 <dialog>，CSS 失效也能用）
   ------------------------------------------------------------------------- */
.transfer-dialog {
  width: min(480px, 92vw);
  padding: 0;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  background: #fff;
}
.transfer-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.transfer-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 15px;
}
.transfer-dialog__close {
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.transfer-dialog__close:hover {
  color: var(--text, #1f2937);
  background: var(--surface-hover, #f2f3f5);
  border-radius: 4px;
}
.transfer-dialog__body {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.transfer-dialog__summary {
  margin: 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--brand-soft, #e8efff);
  color: var(--text, #1f2937);
  font-size: 13px;
  line-height: 1.6;
}
.transfer-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border, #e5e7eb);
}

/* -------------------------------------------------------------------------
   workspace — 主播-账号工作台（左右两栏 master-detail 布局）
   ------------------------------------------------------------------------- */
.workspace-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 12px;
  margin-top: 12px;
}
.workspace-master {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.workspace-master-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.workspace-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  font-size: 13px;
}
.workspace-search:focus {
  outline: none;
  border-color: var(--brand, #2e6cef);
  box-shadow: 0 0 0 2px var(--brand-soft, rgba(46, 108, 239, 0.15));
}
.workspace-master-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.workspace-master-list li + li {
  border-top: 1px solid var(--border-soft, #f2f3f5);
}
.workspace-master-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text, #1f2937);
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.workspace-master-item:hover {
  background: var(--surface-hover, #f7f8fa);
}
.workspace-master-item.is-active {
  background: var(--brand-soft, #e8efff);
  border-left-color: var(--brand, #2e6cef);
}
.workspace-master-item__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.workspace-master-item__main strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-master-item__main small {
  color: var(--text-muted, #6b7280);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-master-item__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  flex-shrink: 0;
}
.workspace-master-item__meta small {
  color: var(--text-faint, #86909c);
  font-size: 11px;
}
.workspace-detail {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 16px 20px;
  min-height: 360px;
}
.workspace-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft, #f2f3f5);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* binding-card — 绑定关系卡片 */
.binding-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.binding-card.is-default {
  border-color: var(--brand, #2e6cef);
  box-shadow: 0 0 0 1px var(--brand-soft, rgba(46, 108, 239, 0.18));
}
.binding-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.binding-card__time {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  margin-bottom: 4px;
}
.binding-card__notes {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  padding: 6px 10px;
  background: var(--surface-muted, #f7f8fa);
  border-radius: 4px;
  margin: 6px 0;
  white-space: pre-wrap;
}
.binding-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* timeline-list — 时间线视图 */
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft, #f2f3f5);
}
.timeline-item__time {
  color: var(--text-muted, #6b7280);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.timeline-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.timeline-item__meta {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}
.timeline-item__notes {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  padding: 4px 8px;
  background: var(--surface-muted, #f7f8fa);
  border-radius: 4px;
  white-space: pre-wrap;
}
.timeline-item--create .timeline-item__head { color: var(--text, #1f2937); }
.timeline-item--transferred { background: rgba(46, 108, 239, 0.03); }
.timeline-item--ended { background: rgba(0, 0, 0, 0.02); }

@media (max-width: 920px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .workspace-master {
    max-height: 360px;
  }
  .timeline-item {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   主播-账号管理工作台 v2 (ws-*) — 按设计图实现
   ========================================================================= */

/* Tab 条 */
.ws-tabs {
  display: flex;
  gap: 8px;
  padding: 0;
  margin-top: 8px;
  border-bottom: 1px solid var(--border, #e5e6eb);
}
.ws-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-muted, #4e5969);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.ws-tab:hover { color: var(--text, #1f2329); }
.ws-tab.is-active {
  color: var(--brand, #3370ff);
  border-bottom-color: var(--brand, #3370ff);
}
.ws-tab svg { color: currentColor; }

/* 主布局（master-detail）*/
.ws-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.ws-master,
.ws-detail,
.ws-card {
  background: #fff;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 10px;
}
.ws-master { display: flex; flex-direction: column; max-height: calc(100vh - 240px); overflow: hidden; }
.ws-detail { display: flex; flex-direction: column; gap: 14px; padding: 0; background: transparent; border: 0; }
.ws-card { padding: 16px 20px; }

/* 左侧列表 */
.ws-master__head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border-soft, #f2f3f5);
}
.ws-master__title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.ws-master__title strong { font-size: 14px; }
.ws-master__filters {
  display: flex; gap: 6px;
}
.ws-search {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 6px;
  font-size: 13px;
}
.ws-search:focus {
  outline: none;
  border-color: var(--brand, #3370ff);
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.15);
}
.ws-platform-filter {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.ws-list {
  list-style: none; margin: 0; padding: 0;
  overflow-y: auto;
}
.ws-list li + li { border-top: 1px solid var(--border-soft, #f2f3f5); }
.ws-list-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text, #1f2329);
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.ws-list-item:hover { background: var(--surface-hover, #f7f8fa); }
.ws-list-item.is-active {
  background: rgba(51, 112, 255, 0.08);
  border-left-color: var(--brand, #3370ff);
}
.ws-list-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ws-list-item__title {
  display: flex; align-items: flex-start; gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  line-height: 1.35;
}
.ws-list-item__title strong {
  display: -webkit-box;
  flex: 1 1 120px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ws-list-item__title .platform-chip {
  flex: 0 0 auto;
  margin-top: 1px;
}
.ws-list-item__sub {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.ws-list-item__meta {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  min-width: 0;
}
.ws-list-item__flag {
  color: #b45309;
  line-height: 1.4;
}
.ws-list-item__history { color: var(--text-faint, #86909c); font-size: 11px; flex-shrink: 0; }

/* 缩略图（账号 / 主播）*/
.ws-thumb {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  color: #fff;
  user-select: none;
}
.ws-thumb--xs { width: 22px; height: 22px; font-size: 11px; border-radius: 5px; }
.ws-thumb--sm { width: 32px; height: 32px; font-size: 13px; }
.ws-thumb--lg { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }

/* 平台缩略图配色 */
.ws-thumb--douyin    { background: linear-gradient(135deg, #4a4a4a, #1a1a1a); }
.ws-thumb--kuaishou  { background: linear-gradient(135deg, #ff6e00, #ff9800); }
.ws-thumb--shipinhao { background: linear-gradient(135deg, #07c160, #00a854); }
.ws-thumb--wechat_video { background: linear-gradient(135deg, #07c160, #00a854); }
.ws-thumb--other     { background: linear-gradient(135deg, #6b7280, #4b5563); }

/* 主播缩略图配色（6 色循环）*/
.ws-thumb--anchor-0 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.ws-thumb--anchor-1 { background: linear-gradient(135deg, #10b981, #059669); }
.ws-thumb--anchor-2 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ws-thumb--anchor-3 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.ws-thumb--anchor-4 { background: linear-gradient(135deg, #f97316, #ea580c); }
.ws-thumb--anchor-5 { background: linear-gradient(135deg, #a855f7, #9333ea); }

/* 平台 chip */
.ws-platform-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
}
.ws-platform-chip--douyin    { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.ws-platform-chip--kuaishou  { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.ws-platform-chip--shipinhao { background: #f0fdf4; color: #059669; border-color: #bbf7d0; }
.ws-platform-chip--wechat_video { background: #f0fdf4; color: #059669; border-color: #bbf7d0; }
.ws-platform-chip--other     { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }

/* 通用 pill */
.ws-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  background: #f3f4f6; color: #4b5563;
  border: 1px solid #e5e7eb;
}
.ws-pill--wrap {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.ws-pill--success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.ws-pill--warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.ws-pill--info    { background: rgba(51, 112, 255, 0.1); color: #2c5fdf; border-color: rgba(51, 112, 255, 0.25); }

/* 卡片标题行 */
.ws-card-title-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.ws-title-hint { margin-left: auto; }
.ws-title-info-tip {
  margin-left: auto;
}

/* 账号 / 主播 资料卡 */
.ws-account-profile__head {
  display: flex; gap: 16px; align-items: flex-start;
}
.ws-account-profile__title {
  flex: 1; min-width: 0;
}
.ws-account-profile__title > div:first-child {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.anchor-profile-source-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 12px;
}
.anchor-profile-source-row span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-muted, #f7f8fa);
  color: var(--text-muted, #4e5969);
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ws-account-profile__actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.ws-meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 24px;
  margin: 0;
}
.ws-meta-row > div {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.ws-meta-row dt {
  color: var(--text-faint, #86909c);
  font-size: 11px;
  font-weight: 400;
}
.ws-meta-row dd {
  margin: 0;
  font-size: 13px;
  color: var(--text, #1f2329);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 当前归属：横排卡片 */
.ws-binding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.ws-binding-card {
  position: relative;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 8px;
  padding: 14px 16px 12px;
  background: #fff;
}
.ws-binding-card.is-default {
  border-left: 4px solid var(--brand, #3370ff);
  padding-left: 13px;
}
.ws-binding-card__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.ws-binding-card__name {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.ws-binding-card__name strong { font-size: 14px; }
.ws-binding-card__time {
  font-size: 13px;
  color: var(--text-muted, #4e5969);
  margin-bottom: 6px;
}
.ws-binding-card__notes {
  font-size: 12px;
  color: var(--text-muted, #4e5969);
  padding: 6px 10px;
  background: var(--surface-muted, #f7f8fa);
  border-radius: 4px;
  margin: 6px 0 8px;
  white-space: pre-wrap;
}
.ws-binding-card__actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft, #f2f3f5);
  margin-top: 10px;
}

/* 历史折叠 */
.ws-history-summary {
  cursor: pointer; font-weight: 600; padding: 6px 0;
  display: flex; align-items: center; gap: 10px;
}
.ws-history-table {
  width: 100%; margin-top: 12px; font-size: 13px;
}
.ws-history-table th {
  text-align: left; font-weight: 500; color: var(--text-muted, #4e5969);
  padding: 8px 10px;
  background: var(--surface-muted, #f7f8fa);
  font-size: 12px;
}
.ws-history-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-soft, #f2f3f5);
}

/* 按主播看：名下账号表格 */
.ws-anchor-table {
  width: 100%; font-size: 13px;
}
.ws-anchor-table thead th {
  text-align: left; font-weight: 500;
  color: var(--text-muted, #4e5969);
  padding: 10px 12px;
  background: var(--surface-muted, #f7f8fa);
  font-size: 12px;
  border-bottom: 1px solid var(--border, #e5e6eb);
}
.ws-anchor-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft, #f2f3f5);
  vertical-align: middle;
}
.ws-anchor-table__account {
  display: flex; align-items: center; gap: 8px;
}

/* 底部 grid: 离职 + 最近变更 */
.ws-bottom-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
.ws-danger-card {
  border-color: #fecaca;
  background: #fef2f2;
}
.ws-recent-list {
  list-style: none; margin: 12px 0 0; padding: 0;
}
.ws-recent-list li {
  display: grid;
  grid-template-columns: 40px 12px 1fr;
  gap: 8px;
  padding: 8px 0;
  align-items: start;
}
.ws-recent-date {
  font-size: 12px; color: var(--text-muted, #4e5969);
  font-variant-numeric: tabular-nums;
}
.ws-recent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand, #3370ff);
  margin-top: 4px;
}
.ws-recent-body { font-size: 13px; line-height: 1.6; }
.ws-recent-body strong { display: inline; }

/* 时间线 */
.ws-timeline {
  list-style: none; margin: 0; padding: 0;
}
.ws-timeline-item {
  display: grid;
  grid-template-columns: 160px 12px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft, #f2f3f5);
  align-items: start;
}
.ws-timeline-time {
  color: var(--text-muted, #4e5969);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ws-timeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand, #3370ff);
  margin-top: 6px;
}
.ws-timeline-item--create .ws-timeline-dot { background: #15803d; }
.ws-timeline-item--ended .ws-timeline-dot { background: #b45309; }
.ws-timeline-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Empty state */
.ws-empty {
  background: #fff;
  border: 1px dashed var(--border, #e5e6eb);
  border-radius: 10px;
  padding: 60px 20px;
  text-align: center;
}

/* 弹窗内的 mini chip + 信息卡 / 警告卡 */
.ws-mini-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin: 0 2px;
}
.ws-mini-chip--account { background: rgba(51, 112, 255, 0.1); color: #2c5fdf; }
.ws-mini-chip--anchor { background: #fef2f2; color: #dc2626; }
.ws-info-card {
  display: flex; gap: 8px;
  padding: 10px 12px;
  background: rgba(51, 112, 255, 0.08);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text, #1f2329);
  line-height: 1.6;
}
.ws-info-card svg { flex-shrink: 0; color: var(--brand, #3370ff); margin-top: 2px; }
.ws-warning-card {
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  color: #b45309;
  font-size: 13px;
}
.ws-warning-card ul {
  margin: 6px 0 0; padding-left: 20px; line-height: 1.7;
}
.ws-confirm-field {
  background: #fef9c3;
  padding: 10px;
  border-radius: 6px;
}

/* 参与场景 6 维度网格 */
.ws-visibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.ws-visibility-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 6px;
  font-size: 13px;
  cursor: help;
}
.ws-visibility-item--on {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.ws-visibility-item--off {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #9ca3af;
  text-decoration: line-through;
}
.ws-visibility-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-visibility-item--on .ws-visibility-dot { background: #15803d; }
.ws-visibility-item--off .ws-visibility-dot { background: #d1d5db; }

/* 规则中心 */
.rules-center-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rules-center-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
}

.rules-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.rules-center-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.rules-center-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 15px;
  font-weight: 700;
}

.rules-center-card--legacy .rules-center-card__icon {
  background: #f7f8fa;
  color: #4e5969;
}

.rules-center-card__body h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.rules-center-card__body p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.rules-center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rules-center-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin: 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcff;
}

/* 头像 img 形态 */
.ws-thumb--img {
  background: #f3f4f6;
  object-fit: cover;
  color: transparent;
  border: 1px solid var(--border-soft, #f2f3f5);
}

/* platform fallback 用 SVG（codex 的 platform_labels.py 标准 SVG）*/
.ws-thumb--platform svg {
  width: 60%;
  height: 60%;
  display: block;
}
.ws-thumb--platform.ws-thumb--xs svg { width: 65%; height: 65%; }
.ws-thumb--platform.ws-thumb--lg svg { width: 55%; height: 55%; }

/* 主播 / 账号详情页通用 4 列字段网格 */
.ws-form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.anchor-field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.anchor-field-label-with-help .info-tip {
  margin-left: 2px;
}
.anchor-rate-info-tip .info-tip__bubble,
.ws-title-info-tip .info-tip__bubble {
  width: min(340px, calc(100vw - 32px));
}
@media (max-width: 1100px) { .ws-form-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .ws-form-grid-4 { grid-template-columns: 1fr; } }

.ws-readonly-strip {
  margin-top: 14px;
  padding: 8px 12px;
  background: var(--surface-muted, #f7f8fa);
  border-radius: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ws-anchor-avatar-hint {
  margin-top: 6px;
  text-align: center;
}

/* 主播端可见性 toggle 卡片 */
.ws-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 700px) { .ws-toggle-grid { grid-template-columns: 1fr; } }
.ws-toggle-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.12s, background 0.12s;
}
.ws-toggle-card:hover { border-color: var(--brand, #3370ff); }
.ws-toggle-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ws-toggle-card__head strong { flex: 1; font-size: 14px; }
.ws-toggle-card small { color: var(--text-muted, #4e5969); font-size: 12px; line-height: 1.6; }

/* 自定义 toggle 开关 */
.ws-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ws-toggle-state {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #d1d5db;
  transition: background 0.18s;
  flex-shrink: 0;
}
.ws-toggle-state::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: left 0.18s, transform 0.18s;
}
.ws-toggle-input:checked ~ .ws-toggle-state {
  background: var(--brand, #3370ff);
}
.ws-toggle-input:checked ~ .ws-toggle-state::before {
  left: 18px;
}

/* 主播 / 账号详情顶部 ws-account-profile__head 第一列（头像区）固定宽度 */
.anchor-edit-form .ws-account-profile__head > div:first-child,
.account-edit-form .ws-account-profile__head > div:first-child {
  flex-shrink: 0;
  width: 96px;
  text-align: center;
}

/* 账号缩略图 + "官"角标（官方同步标记）*/
.ws-account-thumb-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.ws-account-thumb-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand, #3370ff);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}

/* 账号管理页 mono 字体 */
.account-edit-form .mono,
.ws-history-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* 弹窗里的 select 视觉锁定 (替代 disabled, 因 disabled 字段不会被表单提交) */
select[data-locked],
input[data-locked] {
  background: #f3f4f6;
  color: #6b7280;
  pointer-events: none;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

/* =========================================================================
   主播端展示配置 + 主播奖金规则 (ah-* 命名空间) + 通用 segmented control
   ========================================================================= */

.ws-segmented {
  display: inline-flex;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.ws-segment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border, #e5e6eb);
  color: var(--text-muted, #4e5969);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ws-segment:last-child { border-right: 0; }
.ws-segment:hover { background: var(--surface-hover, #f2f3f5); color: var(--text, #1f2329); }
.ws-segment.is-active {
  background: var(--brand-soft, rgba(51, 112, 255, 0.1));
  color: var(--brand, #3370ff);
  font-weight: 500;
}

.ah-scope-banner {
  background: linear-gradient(135deg, #ebf0ff 0%, #f7f8fa 100%);
  border: 1px solid #d6e1ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ah-scope-banner__main { flex: 1; min-width: 240px; }
.ah-scope-banner__title { display: block; font-size: 18px; margin: 4px 0 6px; }
.ah-scope-banner__hint { font-size: 12px; line-height: 1.6; }
.ah-scope-segmented { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ah-scope-select {
  padding: 8px 12px;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  min-width: 180px;
}

.ah-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.ah-field-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.12s, background 0.12s;
}
.ah-field-card:hover { border-color: var(--brand, #3370ff); }
.ah-field-card.is-off {
  background: var(--surface-muted, #f7f8fa);
  opacity: 0.7;
}
.ah-field-card.is-off strong {
  color: var(--text-muted, #4e5969);
}
.ah-field-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ah-field-card__head strong { flex: 1; font-size: 13px; }

.ah-source-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.4;
  align-self: flex-start;
}
.ah-source-tag--default { background: #f3f4f6; color: #6b7280; }
.ah-source-tag--anchor { background: #fef3c7; color: #92400e; }
.ah-source-tag--live_account { background: #dbeafe; color: #1e40af; }

.ah-coverage-search-bar {
  display: flex; gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.ah-coverage-search-bar input[type="search"] {
  flex: 1; min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 6px;
  font-size: 13px;
}
.ah-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border-soft, #f2f3f5);
  border-radius: 8px;
  background: var(--surface-muted, #f7f8fa);
}
.ah-coverage-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.ah-coverage-card:hover { border-color: var(--brand, #3370ff); }
.ah-coverage-card input[type="checkbox"]:checked ~ span {
  color: var(--brand, #3370ff);
  font-weight: 500;
}
.ah-coverage-card span small {
  display: block;
  color: var(--text-muted, #4e5969);
  font-size: 11px;
  font-weight: normal;
}

.ah-warn-strip {
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #b45309;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 920px) {
  .ws-layout { grid-template-columns: 1fr; }
  .ws-master { max-height: 360px; }
  .ws-bottom-grid { grid-template-columns: 1fr; }
  .ws-timeline-item { grid-template-columns: 1fr; }
  .ws-account-profile__head { flex-direction: column; }
  .ws-account-profile__actions { width: 100%; flex-wrap: wrap; }
}

/* -------------------------------------------------------------------------
   售灯（lamp sales）— list / detail / inventory polish
   ------------------------------------------------------------------------- */
.lamp-task-table th.num,
.lamp-task-table td.num,
.lamp-inventory-table th.num,
.lamp-inventory-table td.num,
.lamp-movement-table th.num,
.lamp-movement-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.lamp-task-table .cell-strong,
.lamp-inventory-table .cell-strong {
  font-weight: 600;
  color: var(--text-strong, #1d2129);
  line-height: 1.4;
}

.lamp-task-table .cell-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted, #4e5969);
  line-height: 1.4;
}

.lamp-task-table tbody tr:hover {
  background: var(--surface-muted, #f7f8fa);
}

.lamp-detail-summary .stats-grid {
  gap: 12px;
}

.lamp-stat-value {
  font-size: 22px !important;
  line-height: 1.3;
  word-break: break-all;
}

.lamp-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lamp-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
}

.lamp-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-xs, 4px);
  background: var(--surface-muted, #f7f8fa);
}

.lamp-detail-grid > div span.muted {
  font-size: 12px;
}

.lamp-detail-grid > div strong {
  font-weight: 500;
  color: var(--text-strong, #1d2129);
  word-break: break-all;
}

.lamp-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.lamp-photo-card {
  border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface, #ffffff);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lamp-photo-card__media {
  aspect-ratio: 4 / 3;
  background: var(--surface-muted, #f7f8fa);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lamp-photo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lamp-photo-card__placeholder {
  color: var(--text-muted, #4e5969);
  font-size: 12px;
}

.lamp-photo-card__body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.lamp-photo-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lamp-photo-card__desc {
  margin: 0;
  color: var(--text-strong, #1d2129);
  line-height: 1.5;
  word-break: break-word;
}

.lamp-photo-card__url {
  margin: 0;
}

.lamp-inventory-table tbody tr.row-warning {
  background: var(--warning-soft, #fff7e6);
}

.lamp-inventory-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.lamp-inventory-form select,
.lamp-inventory-form input[type="number"],
.lamp-inventory-form input[type="text"],
.lamp-inventory-form input:not([type]) {
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.lamp-inventory-form input[type="number"] {
  width: 110px;
}

.lamp-inventory-form input[name="remark"] {
  width: 140px;
}

.lamp-inventory-form button {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.lamp-inventory-adjust-form {
  max-width: 420px;
}

.lamp-inventory-help,
.lamp-delete-reasons {
  flex-basis: 100%;
  color: var(--text-muted, #4e5969);
  font-size: 12px;
  line-height: 1.5;
}

.lamp-delete-reasons {
  margin-top: 4px;
}

.lamp-delete-reasons strong {
  color: var(--text-strong, #1d2129);
}

.lamp-delete-reasons span {
  display: inline-flex;
  align-items: center;
  margin: 2px 4px 2px 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-muted, #f2f3f5);
  color: var(--text-muted, #4e5969);
}

.lamp-movement-table td.delta-up {
  color: var(--success, #00b42a);
  font-weight: 600;
}

.lamp-movement-table td.delta-down {
  color: var(--danger, #f53f3f);
  font-weight: 600;
}

@media (max-width: 720px) {
  .lamp-detail-grid {
    grid-template-columns: 1fr;
  }
  .lamp-photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .lamp-inventory-form {
    flex-direction: column;
    align-items: stretch;
  }
  .lamp-inventory-form input[type="number"],
  .lamp-inventory-form input[name="remark"] {
    width: 100%;
  }
}

/* =========================================================================
   demo-readiness UI polish — 追加段（按 PR base 文件末尾的 LF 风格）
   --------------------------------------------------------------------------
   说明：
   - 本段只追加新样式或用相同选择器在末尾覆盖少量已有规则（CSS 后定义优先）。
   - 不修改 PR base 中既有的规则文本，保证 diff 只在文件末尾。
   - 命名空间：domain-* / lamp-* / qianchuan-* / login-* / demo-account-*
   ========================================================================= */

/* ---- 登录页：演示账号面板视觉增强 -------------------------------------- */
.demo-account-panel {
  border-color: rgba(51, 112, 255, 0.18);
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.05), rgba(51, 112, 255, 0.02));
  padding: 14px 14px 12px;
}

.demo-account-head {
  margin-bottom: 6px;
}

.demo-account-head-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-account-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.demo-account-pass {
  font-size: 12px;
  color: var(--text-muted);
}

.demo-account-tip {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.demo-account-button {
  min-height: 64px;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.demo-account-button .demo-account-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.demo-account-button strong {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.demo-account-note {
  font-style: normal;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-faint);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.demo-account-button:hover {
  transform: translateY(-1px);
}

.demo-account-button:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 1px;
}

/* ---- 登录页：左侧 feature tag ----------------------------------------- */
.login-feature-item {
  gap: 4px;
}

.login-feature-item .login-feature-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  width: fit-content;
}

/* ---- 登录页：分隔线 + 主播登录入口双行 -------------------------------- */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 11px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.login-divider span {
  padding: 0 4px;
  letter-spacing: 0.06em;
}

.login-anchor-entry {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 44px;
  padding: 6px 10px;
}

.login-anchor-entry__main {
  font-size: 14px;
  font-weight: 600;
  color: #245bdb;
}

.login-anchor-entry__hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- 登录页：440px 窄屏单列演示账号 ----------------------------------- */
@media (max-width: 440px) {
  .demo-account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .demo-account-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ---- dashboard 业务域徽章 --------------------------------------------- */
.domain-panel {
  position: relative;
}

.domain-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--brand);
}

.domain-panel.domain-live::before    { background: var(--brand); }
.domain-panel.domain-lamp::before    { background: #16a34a; }
.domain-panel.domain-salary::before  { background: #f59e0b; }
.domain-panel.domain-system::before  { background: #6b7280; }

.domain-panel > .table-toolbar {
  padding-left: 6px;
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid rgba(51, 112, 255, 0.18);
}

.domain-badge--live   { background: rgba(51, 112, 255, 0.10); color: #245bdb; border-color: rgba(51, 112, 255, 0.22); }
.domain-badge--lamp   { background: rgba(22, 163, 74, 0.10); color: #15803d;  border-color: rgba(22, 163, 74, 0.22); }
.domain-badge--salary { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.domain-badge--system { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }

.panel-title:has(.domain-badge) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.domain-jump {
  position: relative;
  padding-left: 22px;
}

.domain-jump::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}

.domain-jump--live::before   { background: var(--brand); }
.domain-jump--lamp::before   { background: #16a34a; }
.domain-jump--salary::before { background: #f59e0b; }
.domain-jump--system::before { background: #6b7280; }

/* ---- 售灯订单列表：状态流转条 + 筛选条 + 状态 chip + 分组标签 ----------- */
.lamp-workflow-steps {
  list-style: none;
  margin: 4px 0 12px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

.lamp-workflow-steps li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.lamp-workflow-steps li:not(.lamp-workflow-branch):not(:last-child)::after {
  content: "→";
  margin-left: 10px;
  color: var(--text-faint);
  font-size: 11px;
}

.lamp-workflow-steps li:not(.lamp-workflow-branch):nth-child(4)::after {
  content: "";
}

.lamp-workflow-branch {
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

.lamp-workflow-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-faint);
}

.lamp-workflow-dot--pending    { background: #94a3b8; }
.lamp-workflow-dot--accepted   { background: var(--brand); }
.lamp-workflow-dot--processing { background: #245bdb; }
.lamp-workflow-dot--active     { background: #0f766e; }
.lamp-workflow-dot--completed  { background: #16a34a; }
.lamp-workflow-dot--due        { background: var(--warning); }
.lamp-workflow-dot--expiry     { background: #f59e0b; }
.lamp-workflow-dot--exception  { background: var(--danger); }

.lamp-filter-bar {
  gap: 6px;
}

.lamp-source-filter {
  display: flex;
  align-items: center;
  min-width: 190px;
  margin-left: auto;
}

.lamp-source-filter label {
  display: grid;
  gap: 4px;
  width: 100%;
  color: var(--text-muted);
  font-size: 12px;
}

.lamp-source-filter select {
  min-height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
}

.lamp-filter-chip {
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text-muted);
  transition: all var(--transition);
}

.lamp-filter-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.lamp-filter-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.lamp-filter-chip--pending.is-active    { background: #475569;       border-color: #475569; }
.lamp-filter-chip--accepted.is-active   { background: var(--brand);  border-color: var(--brand); }
.lamp-filter-chip--processing.is-active { background: #245bdb;       border-color: #245bdb; }
.lamp-filter-chip--active.is-active     { background: #0f766e;       border-color: #0f766e; }
.lamp-filter-chip--due.is-active        { background: var(--warning);border-color: var(--warning); }
.lamp-filter-chip--expiry.is-active     { background: #f59e0b;       border-color: #f59e0b; }
.lamp-filter-chip--exception.is-active  { background: var(--danger); border-color: var(--danger); }
.lamp-filter-chip--completed.is-active  { background: #16a34a;       border-color: #16a34a; }

.lamp-channel-list {
  display: grid;
  gap: 10px;
}

.lamp-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.lamp-channel-row.is-archived {
  opacity: 0.72;
  background: var(--surface-muted);
}

.lamp-workbench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.lamp-workbench-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid #16a34a;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.lamp-workbench-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.lamp-workbench-card span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.lamp-workbench-card strong {
  font-size: 28px;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lamp-workbench-card em {
  align-self: end;
  font-style: normal;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.lamp-workbench-card--pending { border-left-color: #475569; }
.lamp-workbench-card--accepted { border-left-color: var(--brand); }
.lamp-workbench-card--processing { border-left-color: #245bdb; }
.lamp-workbench-card--active { border-left-color: #0f766e; }
.lamp-workbench-card--due { border-left-color: var(--warning); }
.lamp-workbench-card--expiry { border-left-color: #f59e0b; }
.lamp-workbench-card--exception { border-left-color: var(--danger); }
.lamp-workbench-card--photo { border-left-color: #7c3aed; }
.lamp-workbench-card--completed { border-left-color: #16a34a; }
.lamp-workbench-card--remark { border-left-color: #db2777; }
.lamp-workbench-card--modified { border-left-color: #6b7280; }
.lamp-workbench-card--stock { border-left-color: #f97316; }

.lamp-status-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.lamp-status-chip--pending    { background: #f1f5f9;                       color: #475569;  border-color: #cbd5e1; }
.lamp-status-chip--accepted   { background: rgba(51, 112, 255, 0.10);      color: #245bdb;  border-color: rgba(51, 112, 255, 0.28); }
.lamp-status-chip--processing { background: rgba(36, 91, 219, 0.12);       color: #1f3fa5;  border-color: rgba(36, 91, 219, 0.30); }
.lamp-status-chip--active     { background: rgba(15, 118, 110, 0.12);      color: #0f766e;  border-color: rgba(15, 118, 110, 0.28); }
.lamp-status-chip--completed  { background: rgba(22, 163, 74, 0.12);       color: #15803d;  border-color: rgba(22, 163, 74, 0.28); }
.lamp-status-chip--exception  { background: rgba(245, 63, 63, 0.10);       color: #b91c1c;  border-color: rgba(245, 63, 63, 0.28); }

.lamp-status-chip--lg {
  height: 24px;
  padding: 0 12px;
  font-size: 13px;
}

.lamp-task-row--exception > td { background: rgba(245, 63, 63, 0.04); }
.lamp-task-row--completed > td { color: var(--text-muted); }

.lamp-group-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 10px;
  border-radius: var(--radius-xs);
  background: rgba(51, 112, 255, 0.08);
  color: #245bdb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  word-break: break-all;
}

.lamp-progress {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.lamp-progress strong {
  color: var(--text);
  font-weight: 600;
}

.lamp-remark-inline {
  display: grid;
  gap: 2px;
  margin-top: 6px;
}

.lamp-remark-inline small {
  color: var(--text-muted);
  line-height: 1.45;
  word-break: break-word;
}

.lamp-remark-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(219, 39, 119, 0.10);
  color: #be185d;
  border: 1px solid rgba(219, 39, 119, 0.24);
  font-size: 11px;
  font-weight: 600;
}

.lamp-remark-panel {
  border-left: 4px solid #db2777;
  background: linear-gradient(180deg, rgba(219, 39, 119, 0.04), var(--surface-solid));
}

.lamp-remark-panel p {
  margin: 8px 0 0;
  line-height: 1.65;
  color: var(--text);
  word-break: break-word;
}

/* ---- 售灯列表表格：表头 / 行 hover 增强 ------------------------------- */
.lamp-task-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lamp-task-table tbody tr:hover {
  background: rgba(51, 112, 255, 0.04);
}

.lamp-task-table tbody tr.lamp-task-row--exception:hover { background: rgba(245, 63, 63, 0.06); }
.lamp-task-table tbody tr.lamp-task-row--completed:hover { background: rgba(22, 163, 74, 0.04); }

.lamp-task-table td { vertical-align: middle; }

/* ---- 售灯详情：状态 hero ---------------------------------------------- */
.lamp-detail-hero {
  border-top: 4px solid #16a34a;
  padding: 22px 24px 20px;
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.05), rgba(255, 255, 255, 0)) , var(--surface-solid);
}

.lamp-detail-hero--exception  { border-top-color: var(--danger); background: linear-gradient(180deg, rgba(245, 63, 63, 0.05), rgba(255, 255, 255, 0)) , var(--surface-solid); }
.lamp-detail-hero--completed  { border-top-color: #16a34a; }
.lamp-detail-hero--processing { border-top-color: #245bdb; background: linear-gradient(180deg, rgba(36, 91, 219, 0.05), rgba(255, 255, 255, 0)) , var(--surface-solid); }
.lamp-detail-hero--accepted   { border-top-color: var(--brand); background: linear-gradient(180deg, rgba(51, 112, 255, 0.05), rgba(255, 255, 255, 0)) , var(--surface-solid); }
.lamp-detail-hero--pending    { border-top-color: #94a3b8; background: linear-gradient(180deg, rgba(148, 163, 184, 0.06), rgba(255, 255, 255, 0)) , var(--surface-solid); }

.lamp-detail-hero__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}

.lamp-detail-hero__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lamp-detail-hero__title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.lamp-detail-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 12px;
  color: var(--text-muted);
}

.lamp-detail-hero__meta strong {
  color: var(--text);
  font-weight: 600;
}

.lamp-detail-hero__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
}

.lamp-hero-metric {
  display: grid;
  gap: 4px;
}

.lamp-hero-metric__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.lamp-hero-metric__value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.lamp-hero-metric__value em {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.lamp-hero-metric__value--text {
  font-size: 17px;
  line-height: 1.35;
  word-break: break-all;
}

.lamp-hero-metric__note {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

.lamp-progress-bar {
  position: relative;
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.lamp-progress-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.3s ease;
}

/* ---- 售灯详情：流程操作分主次 ----------------------------------------- */
.lamp-action-intro {
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.05), var(--surface-solid));
  border-color: rgba(51, 112, 255, 0.18);
}

.lamp-action-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lamp-action-card {
  border-color: var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.lamp-action-card--primary {
  border-left: 3px solid var(--brand);
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.04), var(--surface-solid));
}

.lamp-action-card--exception {
  border-left: 3px solid var(--danger);
  background: linear-gradient(180deg, rgba(245, 63, 63, 0.03), var(--surface-solid));
}

.lamp-action-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.lamp-recommendation-callout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(22, 163, 74, 0.08));
  color: var(--text);
}

.lamp-recommendation-callout strong {
  color: #1d4ed8;
  font-weight: 800;
}

.lamp-recommendation-callout span:not(.lamp-recommendation-badge) {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.lamp-recommendation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20);
  white-space: nowrap;
}

.lamp-recommendation-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}

.lamp-recommendation-inline strong {
  color: #1d4ed8;
  font-weight: 800;
}

.lamp-recommendation-inline--mobile {
  display: flex;
  width: fit-content;
  max-width: 100%;
}

.lamp-action-step {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lamp-action-step--exception { background: rgba(245, 63, 63, 0.10); color: var(--danger); }
.lamp-action-step--renew     { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.lamp-primary-action {
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lamp-primary-action:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

/* ---- 售灯详情：已完成 / 异常只读 banner -------------------------------- */
.lamp-readonly-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  border-left: 3px solid var(--text-faint);
  background: var(--surface-muted);
}

.lamp-readonly-banner--success   { border-left-color: #16a34a;       background: rgba(22, 163, 74, 0.05); }
.lamp-readonly-banner--exception { border-left-color: var(--danger); background: rgba(245, 63, 63, 0.04); }

.lamp-readonly-banner__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.lamp-readonly-banner--success   .lamp-readonly-banner__icon { color: #16a34a;       border-color: rgba(22, 163, 74, 0.4); }
.lamp-readonly-banner--exception .lamp-readonly-banner__icon { color: var(--danger); border-color: rgba(245, 63, 63, 0.4); }

.lamp-readonly-banner__body {
  flex: 1;
  min-width: 0;
}

.lamp-readonly-banner__body strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.lamp-readonly-banner__body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.lamp-readonly-banner__note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

/* ---- 库存页：概览统计条 / 分组徽章 / 行突出 ---------------------------- */
.lamp-inventory-summary {
  padding-top: 16px;
}

.lamp-inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.lamp-inventory-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 30px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.lamp-inventory-tab strong {
  font-size: 13px;
  line-height: 1.2;
  color: inherit;
}

.lamp-inventory-tab small {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-subtle);
}

.lamp-inventory-tab:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-solid);
}

.lamp-inventory-tab.is-active {
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.28);
  background: #ffffff;
}

.lamp-inventory-current-view {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--radius-xs);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}

.lamp-inventory-current-view strong {
  white-space: nowrap;
  color: #1d4ed8;
}

.lamp-inventory-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.lamp-inventory-stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  display: grid;
  gap: 2px;
}

.lamp-inventory-stat span { color: var(--text-muted); font-size: 12px; }

.lamp-inventory-stat strong {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lamp-inventory-stat em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
}

.lamp-inventory-stat--warn {
  border-color: rgba(255, 125, 0, 0.28);
  background: rgba(255, 125, 0, 0.05);
}

.lamp-inventory-stat--warn strong { color: var(--warning); }

.lamp-section-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(22, 163, 74, 0.22);
}

.lamp-section-badge--movement {
  background: rgba(51, 112, 255, 0.10);
  color: #245bdb;
  border-color: rgba(51, 112, 255, 0.22);
}

.lamp-spec-days {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lamp-stock-num {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lamp-stock-num--low { color: var(--warning); }

.lamp-inventory-row--low > td { background: rgba(255, 125, 0, 0.06); }

.lamp-inventory-section--movements {
  border-top: 3px solid rgba(51, 112, 255, 0.18);
}

.lamp-inventory-form-panel {
  border-color: var(--border);
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.03), var(--surface-solid));
}

.lamp-inventory-guide {
  border-left: 4px solid rgba(22, 163, 74, 0.45);
}

.lamp-inventory-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.lamp-inventory-guide-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.lamp-inventory-guide-grid strong {
  color: var(--text);
  font-size: 13px;
}

.lamp-inventory-guide-grid span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.lamp-inventory-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

/* ---- 千川配置页：演示保护 banner / 状态色 ----------------------------- */
.qianchuan-demo-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 125, 0, 0.06), rgba(255, 125, 0, 0.02));
  border: 1px solid rgba(255, 125, 0, 0.30);
  border-left: 4px solid var(--warning);
}

.qianchuan-demo-banner__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--warning);
  border: 1px solid rgba(255, 125, 0, 0.4);
}

.qianchuan-demo-banner__body {
  flex: 1;
  min-width: 0;
}

.qianchuan-demo-banner__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.qianchuan-demo-banner__head strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.qianchuan-demo-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--warning);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.qianchuan-demo-banner__body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.qianchuan-hero {
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.04), var(--surface-solid));
  border-color: rgba(51, 112, 255, 0.18);
}

.qianchuan-status-strip { gap: 10px; }

.qianchuan-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px !important;
  font-weight: 600;
  line-height: 1.3;
}

.qianchuan-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.qianchuan-status--ok     { color: #059669; }
.qianchuan-status--demo   { color: var(--warning); }
.qianchuan-status--warn   { color: var(--warning); }
.qianchuan-status--danger { color: var(--danger); }

/* ---- 移动端 720px 适配（新组件） -------------------------------------- */
@media (max-width: 720px) {
  /* 详情 hero */
  .lamp-detail-hero { padding: 18px 16px 16px; }
  .lamp-detail-hero__title h3 { font-size: 18px; }
  .lamp-detail-hero__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lamp-hero-metric__value { font-size: 18px; }
  .lamp-hero-metric__value--text { font-size: 15px; }

  /* 状态流转条 / 筛选条 */
  .lamp-workflow-steps { font-size: 11px; gap: 4px 10px; padding: 8px 10px; }
  .lamp-workflow-branch { margin-left: 0; padding-left: 0; border-left: 0; }
  .lamp-workbench-grid { grid-template-columns: 1fr; }
  .lamp-workbench-card { min-height: auto; }
  .lamp-filter-bar { gap: 4px; }
  .lamp-source-filter { width: 100%; margin-left: 0; }
  .lamp-channel-row { align-items: flex-start; flex-direction: column; }
  .lamp-filter-chip { font-size: 12px; padding: 0 8px; }
  .lamp-inventory-tabs { gap: 6px; padding: 6px; }
  .lamp-inventory-tab { flex: 1 1 calc(50% - 6px); justify-content: center; font-size: 12px; padding: 8px; }
  .lamp-inventory-tab small { display: none; }
  .lamp-inventory-current-view { align-items: flex-start; flex-direction: column; gap: 4px; }

  /* 表格允许横向滚动 */
  .lamp-task-table,
  .lamp-inventory-table,
  .lamp-movement-table { min-width: 720px; }

  /* 库存统计条 */
  .lamp-inventory-stats { grid-template-columns: 1fr; }

  /* dashboard 业务域跳转按钮 */
  .domain-jump { padding-left: 18px; font-size: 12px; }
  .domain-jump::before { left: 8px; width: 5px; height: 5px; }

  /* 流程操作单列 */
  .lamp-action-grid { grid-template-columns: 1fr; }

  /* 千川 banner */
  .qianchuan-demo-banner { padding: 14px 16px; }
  .qianchuan-demo-banner__icon { width: 32px; height: 32px; }

  /* 业务域 panel 留 padding */
  .domain-panel { padding: 18px 16px 18px 18px; }
}

/* =========================================================================
   demo-readiness UI polish — 720px 移动端横向溢出修复（追加补丁）
   --------------------------------------------------------------------------
   修三个问题：
   1. /operations/lamp-tasks       scrollWidth 757 > 720（.lamp-task-table）
   2. /operations/inventory        scrollWidth 757 > 720（.lamp-inventory-table / .lamp-movement-table）
   3. /qianchuan/settings          scrollWidth 809 > 720（.help-tip__content 右溢出）

   策略：CSS 后定义优先，纯追加，不动 PR base 字节、不动模板。
   - 表格：表格 min-width 收窄到 580px，配合 .table-wrap 内 overflow-x: auto 滚动
   - 帮助气泡：720px 改为 position:fixed 底部 toast 风格，左右各留 16px
   - 兜底：.main-inner 在 720px 加 overflow-x: hidden（不动 body）防止任何
     新组件溢出撑出页面，但保留 .table-wrap / .help-tip 自己的滚动 / fixed
   ========================================================================= */

@media (max-width: 720px) {
  /* ---- 兜底：让 main-inner 不被子元素撑出视口 ------------------------- */
  .main-inner {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* ---- 表格容器：保证 .table-wrap 横向滚动 --------------------------- */
  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ---- 表格本体：收窄 min-width，让 .table-wrap 内滚动 ---------------- */
  .lamp-task-table,
  .lamp-inventory-table,
  .lamp-movement-table {
    min-width: 580px;
  }

  /* ---- 帮助气泡：移动端固定到屏幕底部 toast，永不右溢出 --------------- */
  .help-tip__content {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    top: auto;
    width: auto;
    max-width: none;
    transform: translateY(8px);
  }

  .help-tip__content::after {
    display: none;
  }

  .help-tip:hover .help-tip__content,
  .help-tip:focus .help-tip__content,
  .help-tip:focus-within .help-tip__content {
    transform: translateY(0);
  }
}

/* =========================================================================
   角色权限 UI 美化 — 追加段（保持 PR base 字节不变，纯 LF 追加）
   ---------------------------------------------------------------------------
   命名空间：
     .role-*                角色 / 权限 / 审批通用
     .role-domain-*         按业务域分组（首页/直播/千川/售灯/薪酬/系统/H5/历史）
     .role-policy-*         敏感操作策略
     .role-approval-*       授权审批
   ========================================================================= */

/* ---- 通用：业务徽章 ----------------------------------------------------- */
.role-section-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid rgba(51, 112, 255, 0.18);
  white-space: nowrap;
}

.role-section-badge--system  { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.role-section-badge--custom  { background: rgba(22, 163, 74, 0.10); color: #15803d; border-color: rgba(22, 163, 74, 0.22); }
.role-section-badge--module  { background: rgba(51, 112, 255, 0.10); color: #245bdb; border-color: rgba(51, 112, 255, 0.22); }
.role-section-badge--confirm { background: rgba(245, 63, 63, 0.08); color: #b91c1c; border-color: rgba(245, 63, 63, 0.28); }
.role-section-badge--policy  { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }
.role-section-badge--approve { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }

.panel-title:has(.role-section-badge),
.panel-title:has(.role-domain-badge) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ---- /roles 列表页 ----------------------------------------------------- */
.role-list-panel { position: relative; }

.role-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.role-table th.num,
.role-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.role-row > td { vertical-align: middle; }

.role-row--system > td   { background: rgba(245, 158, 11, 0.03); }
.role-row--archived > td { color: var(--text-muted); }

.role-row:hover > td        { background: rgba(51, 112, 255, 0.04); }
.role-row--system:hover > td { background: rgba(245, 158, 11, 0.06); }

.role-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.role-cell__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.role-cell__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
}

.role-cell__key {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  width: fit-content;
  word-break: break-all;
}

.role-status-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.role-status-chip--active   { background: rgba(22, 163, 74, 0.12); color: #15803d; border-color: rgba(22, 163, 74, 0.28); }
.role-status-chip--archived { background: rgba(107, 114, 128, 0.10); color: #4b5563; border-color: rgba(107, 114, 128, 0.22); }
.role-status-chip--system   { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.role-status-chip--custom   { background: rgba(22, 163, 74, 0.10); color: #15803d; border-color: rgba(22, 163, 74, 0.22); }

.role-metric {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.role-action-form {
  display: inline;
  margin: 0;
}

.role-action {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  min-width: 0;
  min-height: 0;
  box-shadow: none;
}

.role-action:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.role-action--primary {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: rgba(51, 112, 255, 0.28);
  font-weight: 600;
}

.role-action--primary:hover {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.role-action--ghost { background: transparent; }

/* ---- /roles/<id> 资料页 ------------------------------------------------ */
.role-form-grid { align-items: flex-start; }

.role-form-panel {
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.03), var(--surface-solid));
}

.role-status-panel { background: var(--surface-solid); }

.role-status-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.role-status-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.role-status-stat > span {
  font-size: 12px;
  color: var(--text-muted);
}

.role-status-stat > strong {
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.role-user-section-title {
  margin-top: 8px;
  margin-bottom: 8px;
}

.role-user-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-user-chip {
  font-size: 12px;
  word-break: break-all;
}

.role-empty-users { margin-top: 8px; }

/* ---- 模块二级导航 ------------------------------------------------------ */
.role-module-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.role-module-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  min-width: 0;
}

.role-module-tab:hover {
  border-color: var(--brand);
  background: rgba(51, 112, 255, 0.04);
  box-shadow: var(--shadow-sm);
}

.role-module-tab.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px rgba(51, 112, 255, 0.22) inset;
}

.role-module-tab__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.role-module-tab.is-active .role-module-tab__icon {
  background: var(--brand-strong);
}

.role-module-tab__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.role-module-tab__body strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.role-module-tab__body small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.role-module-tab.is-active .role-module-tab__body strong {
  color: var(--brand-strong);
}

.role-relationship-card {
  position: relative;
  border-left: 3px solid var(--brand) !important;
}

.role-relationship-card--perm    { border-left-color: var(--brand) !important; }
.role-relationship-card--policy  { border-left-color: var(--warning) !important; }
.role-relationship-card--approve { border-left-color: #16a34a !important; }

/* ---- /roles/<id>/permissions 高危确认 ------------------------------- */
.role-confirm-panel {
  background: linear-gradient(180deg, rgba(245, 63, 63, 0.03), var(--surface-solid));
  border-color: rgba(245, 63, 63, 0.18);
}

/* ---- 按业务域分组 ----------------------------------------------------- */
.role-domain-panel { position: relative; }

.role-domain-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--brand);
}

.role-domain-panel--overview::before  { background: #6b7280; }
.role-domain-panel--live::before      { background: var(--brand); }
.role-domain-panel--qianchuan::before { background: #8b5cf6; }
.role-domain-panel--lamp::before      { background: #16a34a; }
.role-domain-panel--payroll::before   { background: #f59e0b; }
.role-domain-panel--system::before    { background: #6b7280; }
.role-domain-panel--mobile::before    { background: #0ea5e9; }
.role-domain-panel--legacy::before    { background: #9ca3af; }

.role-domain-panel > .table-toolbar { padding-left: 6px; }

.role-domain-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid rgba(51, 112, 255, 0.18);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.role-domain-badge--overview  { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }
.role-domain-badge--live      { background: rgba(51, 112, 255, 0.10);  color: #245bdb; border-color: rgba(51, 112, 255, 0.22); }
.role-domain-badge--qianchuan { background: rgba(139, 92, 246, 0.10);  color: #6d28d9; border-color: rgba(139, 92, 246, 0.22); }
.role-domain-badge--lamp      { background: rgba(22, 163, 74, 0.10);   color: #15803d; border-color: rgba(22, 163, 74, 0.22); }
.role-domain-badge--payroll   { background: rgba(245, 158, 11, 0.12);  color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.role-domain-badge--system    { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }
.role-domain-badge--mobile    { background: rgba(14, 165, 233, 0.10);  color: #0369a1; border-color: rgba(14, 165, 233, 0.22); }
.role-domain-badge--legacy    { background: rgba(156, 163, 175, 0.14); color: #4b5563; border-color: rgba(156, 163, 175, 0.28); }

.role-domain-count {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}

.role-resource-stack {
  display: grid;
  gap: 14px;
}

.role-resource-block {
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.role-resource-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-soft);
}

.role-resource-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.role-resource-key {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

/* 权限卡片：高危醒目但不刺眼 */
.permission-card--high-risk {
  border-color: rgba(245, 63, 63, 0.28);
  background: rgba(245, 63, 63, 0.03);
}

.role-risk-chip {
  font-size: 11px;
  height: 18px;
  padding: 0 8px;
  letter-spacing: 0.02em;
}

/* ---- /security/sensitive-operations 策略页 ---------------------------- */
.role-help-panel {
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.04), var(--surface-solid));
  border-color: rgba(51, 112, 255, 0.18);
}

.role-help-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.role-help-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

.role-help-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.role-help-tag--on     { background: rgba(22, 163, 74, 0.10);  color: #15803d; border-color: rgba(22, 163, 74, 0.22); }
.role-help-tag--need   { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.role-help-tag--bypass { background: rgba(51, 112, 255, 0.10); color: #245bdb; border-color: rgba(51, 112, 255, 0.22); }
.role-help-tag--user   { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }

.role-policy-panel { position: relative; }

.role-policy-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.role-policy-row > td { vertical-align: top; }

.role-policy-row--off > td {
  background: rgba(107, 114, 128, 0.03);
  color: var(--text-muted);
}

.role-policy-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.role-policy-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.role-policy-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.role-policy-category {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.role-policy-key {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.role-policy-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.role-policy-switches {
  display: grid;
  gap: 6px;
}

.role-policy-switch {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
  margin: 0;
}

.role-policy-switch:hover { background: rgba(51, 112, 255, 0.06); }

.role-policy-switch input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
}

.role-policy-switch span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.role-policy-switch strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.role-policy-switch small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.role-policy-user-grid {
  max-height: 260px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--surface-solid);
}

.role-policy-actions { margin-top: 16px; }

/* ---- /security/approvals 审批列表 ------------------------------------- */
.role-approval-filter-panel { padding-bottom: 14px; }

.role-approval-tabs { margin-top: 8px; margin-bottom: 0; }

.role-approval-tab { font-weight: 500; }

.role-approval-tab--pending.active   { background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.5); color: #b45309; }
.role-approval-tab--executed.active  { background: rgba(22, 163, 74, 0.12);  border-color: rgba(22, 163, 74, 0.45); color: #15803d; }
.role-approval-tab--rejected.active,
.role-approval-tab--failed.active    { background: rgba(245, 63, 63, 0.10);  border-color: rgba(245, 63, 63, 0.45); color: #b91c1c; }
.role-approval-tab--expired.active   { background: rgba(107, 114, 128, 0.10); border-color: rgba(107, 114, 128, 0.4); color: #4b5563; }

.role-approval-list-panel { position: relative; }

.role-approval-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.role-approval-row > td { vertical-align: top; }

.role-approval-row--pending > td { background: rgba(245, 158, 11, 0.04); }
.role-approval-row--rejected > td,
.role-approval-row--failed > td  { background: rgba(245, 63, 63, 0.03); }

.role-approval-row:hover > td    { background: rgba(51, 112, 255, 0.04); }
.role-approval-row--pending:hover > td  { background: rgba(245, 158, 11, 0.08); }
.role-approval-row--rejected:hover > td,
.role-approval-row--failed:hover > td   { background: rgba(245, 63, 63, 0.06); }

.role-approval-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.role-approval-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.role-approval-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.role-approval-category {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.role-approval-key {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.role-approval-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  word-break: break-word;
}

.role-approval-subtle {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.45;
}

.role-approval-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.role-approval-action {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(51, 112, 255, 0.28);
  white-space: nowrap;
}

.role-approval-action:hover {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* ---- 审批详情页 ------------------------------------------------------- */
.role-approval-detail-panel {
  border-top: 4px solid var(--text-faint);
  background: linear-gradient(180deg, rgba(107, 114, 128, 0.04), var(--surface-solid));
}

.role-approval-detail-panel--pending   { border-top-color: var(--warning); background: linear-gradient(180deg, rgba(245, 158, 11, 0.05), var(--surface-solid)); }
.role-approval-detail-panel--executed  { border-top-color: #16a34a;       background: linear-gradient(180deg, rgba(22, 163, 74, 0.05), var(--surface-solid)); }
.role-approval-detail-panel--rejected,
.role-approval-detail-panel--failed    { border-top-color: var(--danger); background: linear-gradient(180deg, rgba(245, 63, 63, 0.05), var(--surface-solid)); }
.role-approval-detail-panel--expired   { border-top-color: #94a3b8;       background: linear-gradient(180deg, rgba(148, 163, 184, 0.05), var(--surface-solid)); }

.role-approval-detail-head {
  flex-wrap: wrap;
}

.role-approval-detail-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.role-approval-detail-status { flex-shrink: 0; }

.role-approval-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.role-approval-detail-grid strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.role-approval-summary {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

.role-approval-note {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.role-approval-note p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.role-approval-note--reject { border-left: 3px solid var(--warning); }
.role-approval-note--error  { border-left: 3px solid var(--danger); }

.role-approval-payload { margin-top: 14px; }

.role-approval-payload pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
}

.role-approval-action-panel { background: var(--surface-solid); }

.role-approval-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.role-approval-action-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.role-approval-action-form strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.role-approval-action-form--approve {
  border-left: 3px solid #16a34a;
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.04), var(--surface-solid));
}

.role-approval-action-form--reject {
  border-left: 3px solid var(--danger);
  background: linear-gradient(180deg, rgba(245, 63, 63, 0.04), var(--surface-solid));
}

.role-approval-action-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text);
}

.role-approval-action-form textarea {
  width: 100%;
}

/* ---- 移动端 720px ----------------------------------------------------- */
@media (max-width: 720px) {
  /* /roles 列表：表格滚动 + 操作单列 */
  .role-table { min-width: 600px; }
  .role-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  .role-action { width: 100%; justify-content: center; }
  .role-action-form,
  .role-action-form .role-action { width: 100%; }

  /* /roles/<id> 资料页 */
  .role-status-stats { grid-template-columns: 1fr; }

  /* 模块二级导航 */
  .role-module-nav { grid-template-columns: 1fr; }

  /* 权限页：业务域 panel 留 padding */
  .role-domain-panel { padding-left: 18px; }

  .role-resource-head { gap: 4px; }

  /* 策略表 + 审批表 收窄滚动 */
  .role-policy-table,
  .role-approval-table { min-width: 720px; }

  .role-policy-user-grid {
    grid-template-columns: 1fr;
    max-height: 200px;
  }

  /* 审批详情：双栏改单栏 */
  .role-approval-actions { grid-template-columns: 1fr; }
  .role-approval-detail-head { flex-direction: column; align-items: stretch; }
  .role-approval-detail-status { align-self: flex-start; }

  /* 帮助条 tag 缩小 */
  .role-help-list li { font-size: 12px; }
  .role-help-tag { font-size: 10px; height: 18px; padding: 0 8px; }
}

/* =========================================================================
   角色权限 UI 重做 — redesign 追加段
   ---------------------------------------------------------------------------
   命名空间 .rp-* （role-permission redesign）独立于已有 .role-*
   保持 PR base 字节不变，纯 LF 追加。
   ========================================================================= */

/* ---- 通用按钮 / 标签 / 通知 ------------------------------------------ */
.rp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  box-shadow: none;
  min-width: 0;
  min-height: 0;
}

.rp-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.rp-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
}

.rp-btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.rp-btn--ghost {
  background: transparent;
  color: var(--text);
}

.rp-btn--danger-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.rp-btn--danger-ghost:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(245, 63, 63, 0.06);
}

.rp-btn-form {
  display: inline;
  margin: 0;
}

.rp-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.rp-tag--system   { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.rp-tag--custom   { background: rgba(22, 163, 74, 0.10);  color: #15803d; border-color: rgba(22, 163, 74, 0.22); }
.rp-tag--active   { background: rgba(22, 163, 74, 0.12);  color: #15803d; border-color: rgba(22, 163, 74, 0.28); }
.rp-tag--archived { background: rgba(107, 114, 128, 0.10); color: #4b5563; border-color: rgba(107, 114, 128, 0.22); }

.rp-notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.rp-notice--info {
  border-color: rgba(51, 112, 255, 0.22);
  background: rgba(51, 112, 255, 0.05);
}

.rp-notice strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.rp-notice p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ---- 模块二级导航 segmented control ----------------------------------- */
.rp-nav-panel {
  display: grid;
  gap: 16px;
}

.rp-nav-header__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rp-nav-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.rp-nav-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-segmented {
  display: inline-flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.rp-segmented__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  justify-content: center;
}

.rp-segmented__item:hover {
  color: var(--text);
  background: var(--surface-solid);
}

.rp-segmented__item.is-active {
  background: var(--surface-solid);
  color: var(--brand-strong);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px var(--brand) inset;
}

.rp-segmented__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.rp-segmented__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-relations {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rp-relation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
}

.rp-relation__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--brand);
}

.rp-relation--perm    .rp-relation__dot { background: var(--brand); }
.rp-relation--policy  .rp-relation__dot { background: var(--warning); }
.rp-relation--approve .rp-relation__dot { background: #16a34a; }

.rp-relation__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rp-relation__body strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.rp-relation__body span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

/* ---- /roles section --------------------------------------------------- */
.rp-section { position: relative; }

.rp-section__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.rp-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rp-section__title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.rp-section__badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid rgba(51, 112, 255, 0.18);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rp-section__badge--system { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.rp-section__badge--custom { background: rgba(22, 163, 74, 0.10);  color: #15803d; border-color: rgba(22, 163, 74, 0.22); }
.rp-section__badge--module { background: rgba(51, 112, 255, 0.10); color: #245bdb; border-color: rgba(51, 112, 255, 0.22); }

.rp-section__count {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.rp-section__note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-section__action {
  align-self: flex-start;
  margin-top: 4px;
}

.rp-empty-cta {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 32px 20px;
}

.rp-empty-cta strong {
  font-size: 15px;
  color: var(--text);
}

.rp-empty-cta span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ---- 角色卡片网格 ----------------------------------------------------- */
.rp-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.rp-role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-width: 0;
}

.rp-role-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--brand);
}

.rp-role-card--system::before { background: #f59e0b; }
.rp-role-card--custom::before { background: #16a34a; }

.rp-role-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.rp-role-card.is-archived {
  background: var(--surface-muted);
  opacity: 0.85;
}

.rp-role-card__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-role-card__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rp-role-card__title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.rp-role-card__tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rp-role-card__key {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  width: fit-content;
  word-break: break-all;
}

.rp-role-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  min-height: 1.55em;
}

.rp-role-card__desc--empty {
  color: var(--text-faint);
  font-style: italic;
}

.rp-role-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px dashed var(--border-soft);
  border-bottom: 1px dashed var(--border-soft);
}

.rp-role-card__metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rp-role-card__metric dt {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.rp-role-card__metric dd {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.rp-role-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.rp-role-card__actions .rp-btn {
  flex: 0 1 auto;
}

.rp-role-card__actions .rp-btn--primary {
  flex: 1 1 100%;
  min-width: 120px;
}

/* ---- /roles/new 表单 + 步骤 ------------------------------------------ */
.rp-form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}

.rp-form-card,
.rp-form-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rp-form-card__head,
.rp-form-aside__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rp-form-card__head h2,
.rp-form-aside__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.rp-form-aside__lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-form {
  display: grid;
  gap: 14px;
}

.rp-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rp-field--wide { grid-column: 1 / -1; }

.rp-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rp-field input,
.rp-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-solid);
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.rp-field input:focus,
.rp-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.rp-field input[readonly] {
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: default;
}

.rp-field__hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.rp-field__hint code {
  display: inline-block;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
}

.rp-form__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.rp-form-aside {
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.04), var(--surface-solid));
}

.rp-form-aside__subtitle {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rp-form-aside__empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-form-aside__empty strong {
  color: var(--text);
  font-size: 14px;
}

.rp-form-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rp-form-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.rp-form-stat dt {
  color: var(--text-muted);
  font-size: 11px;
}

.rp-form-stat dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.rp-form-stat__num {
  font-size: 20px !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rp-user-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.rp-user-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.rp-user-list__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rp-user-list__chip {
  font-size: 12px;
  word-break: break-all;
  width: fit-content;
}

.rp-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.rp-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.rp-steps__item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.rp-steps__item--current {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px rgba(51, 112, 255, 0.12) inset;
}

.rp-steps__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rp-steps__item:not(.rp-steps__item--current) .rp-steps__num {
  background: var(--text-faint);
}

.rp-steps__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rp-steps__body strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rp-steps__body span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---- 权限页 ----------------------------------------------------------- */
.rp-perm-form {
  display: grid;
  gap: 16px;
}

.rp-domain-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 12px;
  z-index: 5;
}

.rp-domain-nav__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.rp-domain-nav__list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.rp-domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-soft);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.rp-domain-chip:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.rp-domain-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}

.rp-domain-chip__count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-faint);
}

.rp-domain-chip--overview  .rp-domain-chip__dot { background: #6b7280; }
.rp-domain-chip--live      .rp-domain-chip__dot { background: var(--brand); }
.rp-domain-chip--qianchuan .rp-domain-chip__dot { background: #8b5cf6; }
.rp-domain-chip--lamp      .rp-domain-chip__dot { background: #16a34a; }
.rp-domain-chip--payroll   .rp-domain-chip__dot { background: #f59e0b; }
.rp-domain-chip--system    .rp-domain-chip__dot { background: #6b7280; }
.rp-domain-chip--mobile    .rp-domain-chip__dot { background: #0ea5e9; }
.rp-domain-chip--legacy    .rp-domain-chip__dot { background: #9ca3af; }

/* 确认 banner */
.rp-confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), var(--surface-solid));
  border-color: rgba(245, 158, 11, 0.28);
}

.rp-confirm__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rp-confirm__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.rp-confirm__copy {
  min-width: 0;
  flex: 1;
}

.rp-confirm__copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.rp-confirm__copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-confirm__check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  cursor: pointer;
}

.rp-confirm__check span {
  font-size: 13px;
  color: var(--text);
}

.rp-confirm__note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.rp-confirm__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 业务域 section */
.rp-domain-section { position: relative; }

.rp-domain-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--brand);
}

.rp-domain-section--overview::before  { background: #6b7280; }
.rp-domain-section--live::before      { background: var(--brand); }
.rp-domain-section--qianchuan::before { background: #8b5cf6; }
.rp-domain-section--lamp::before      { background: #16a34a; }
.rp-domain-section--payroll::before   { background: #f59e0b; }
.rp-domain-section--system::before    { background: #6b7280; }
.rp-domain-section--mobile::before    { background: #0ea5e9; }
.rp-domain-section--legacy::before    { background: #9ca3af; }

.rp-domain-section__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.rp-domain-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rp-domain-section__title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.rp-domain-section__badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.rp-domain-section__badge--overview  { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }
.rp-domain-section__badge--live      { background: rgba(51, 112, 255, 0.10);  color: #245bdb; border-color: rgba(51, 112, 255, 0.22); }
.rp-domain-section__badge--qianchuan { background: rgba(139, 92, 246, 0.10);  color: #6d28d9; border-color: rgba(139, 92, 246, 0.22); }
.rp-domain-section__badge--lamp      { background: rgba(22, 163, 74, 0.10);   color: #15803d; border-color: rgba(22, 163, 74, 0.22); }
.rp-domain-section__badge--payroll   { background: rgba(245, 158, 11, 0.12);  color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.rp-domain-section__badge--system    { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }
.rp-domain-section__badge--mobile    { background: rgba(14, 165, 233, 0.10);  color: #0369a1; border-color: rgba(14, 165, 233, 0.22); }
.rp-domain-section__badge--legacy    { background: rgba(156, 163, 175, 0.14); color: #4b5563; border-color: rgba(156, 163, 175, 0.28); }

.rp-domain-section__count {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.rp-domain-section__note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-resource-stack {
  display: grid;
  gap: 12px;
}

.rp-resource {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  overflow: hidden;
}

.rp-resource__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-soft);
}

.rp-resource__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.rp-resource__title h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.rp-resource__key {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.rp-resource__count {
  color: var(--text-muted);
  font-size: 12px;
}

/* 动作行 */
.rp-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rp-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  transition: background var(--transition);
}

.rp-action:first-child { border-top: 0; }

.rp-action:hover {
  background: rgba(51, 112, 255, 0.03);
}

.rp-action--high-risk {
  background: rgba(245, 63, 63, 0.02);
}

.rp-action--high-risk:hover {
  background: rgba(245, 63, 63, 0.05);
}

.rp-action.is-checked {
  background: rgba(51, 112, 255, 0.04);
}

.rp-action.is-checked.rp-action--high-risk {
  background: rgba(245, 63, 63, 0.05);
}

.rp-action__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}

.rp-action__check input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.rp-action__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rp-action__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rp-action__key {
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  line-height: 1.45;
}

.rp-risk-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(245, 63, 63, 0.10);
  color: #b91c1c;
  border: 1px solid rgba(245, 63, 63, 0.28);
  font-size: 11px;
  font-weight: 600;
}

.rp-action__scope {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rp-action__scope-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.rp-action__scope select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text);
  background: var(--surface-solid);
  font-family: inherit;
  box-sizing: border-box;
}

.rp-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(180deg, var(--surface-solid), var(--surface-muted));
}

.rp-bottom-actions small {
  color: var(--text-muted);
  font-size: 12px;
}

.rp-bottom-actions__btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- 敏感操作策略 ----------------------------------------------------- */
.rp-helper {
  display: block;
  padding: 0;
  overflow: hidden;
}

.rp-helper__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-soft);
  list-style: none;
}

.rp-helper__summary::-webkit-details-marker { display: none; }

.rp-helper__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.rp-helper__list {
  margin: 0;
  padding: 14px 18px;
  list-style: none;
  display: grid;
  gap: 8px;
}

.rp-helper__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.rp-helper__tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.rp-helper__tag--on     { background: rgba(22, 163, 74, 0.10);  color: #15803d; border-color: rgba(22, 163, 74, 0.22); }
.rp-helper__tag--need   { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.rp-helper__tag--bypass { background: rgba(51, 112, 255, 0.10); color: #245bdb; border-color: rgba(51, 112, 255, 0.22); }
.rp-helper__tag--user   { background: rgba(107, 114, 128, 0.10); color: #374151; border-color: rgba(107, 114, 128, 0.22); }

.rp-policy-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rp-policy-panel__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rp-policy-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-policy-panel__title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.rp-policy-panel__count {
  color: var(--text-muted);
  font-size: 13px;
}

.rp-policy-panel__note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.rp-policy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.rp-policy-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rp-policy-item--off {
  background: var(--surface-muted);
  opacity: 0.92;
}

.rp-policy-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rp-policy-item__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.rp-policy-item__title strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.rp-policy-item__category {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.rp-policy-item__key {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.rp-policy-item__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.rp-policy-item__body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 1.4fr);
  gap: 14px;
}

.rp-policy-switches,
.rp-policy-users {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.rp-policy-switches legend,
.rp-policy-users legend {
  margin-bottom: 4px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.rp-policy-switch {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  cursor: pointer;
  transition: background var(--transition);
}

.rp-policy-switch:hover { background: rgba(51, 112, 255, 0.06); }

.rp-policy-switch input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
}

.rp-policy-switch span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rp-policy-switch strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rp-policy-switch small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.rp-policy-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs);
  background: var(--surface-solid);
}

.rp-policy-user {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  cursor: pointer;
}

.rp-policy-user input { flex-shrink: 0; margin-top: 2px; }

.rp-policy-user__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rp-policy-user__body strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.rp-policy-user__body small {
  font-size: 11px;
  color: var(--text-faint);
}

.rp-policy-panel__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ---- 授权审批列表 ----------------------------------------------------- */
.rp-approval-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rp-approval-toolbar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rp-approval-toolbar__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.rp-approval-toolbar__count {
  color: var(--text-muted);
  font-size: 13px;
}

.rp-approval-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rp-approval-tab {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-soft);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.rp-approval-tab:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.rp-approval-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
}

.rp-approval-tab--pending.is-active   { background: var(--warning); border-color: var(--warning); }
.rp-approval-tab--executed.is-active  { background: #16a34a;       border-color: #16a34a; }
.rp-approval-tab--rejected.is-active,
.rp-approval-tab--failed.is-active    { background: var(--danger); border-color: var(--danger); }
.rp-approval-tab--expired.is-active   { background: #6b7280;       border-color: #6b7280; }

.rp-approval-panel { padding: 16px; }

.rp-approval-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.rp-approval-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  border-left: 3px solid var(--text-faint);
}

.rp-approval-item--pending  { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.03); }
.rp-approval-item--executed { border-left-color: #16a34a; }
.rp-approval-item--rejected,
.rp-approval-item--failed   { border-left-color: var(--danger); background: rgba(245, 63, 63, 0.03); }
.rp-approval-item--expired  { border-left-color: #6b7280; background: rgba(107, 114, 128, 0.04); }

.rp-approval-item__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.rp-approval-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.rp-approval-item__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.rp-approval-item__status { flex-shrink: 0; }

.rp-approval-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rp-approval-item__category {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
}

.rp-approval-item__key {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.rp-approval-item__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-approval-item__warn {
  margin: 0;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  background: rgba(245, 63, 63, 0.06);
  color: #b91c1c;
  font-size: 12px;
}

.rp-approval-item__facts {
  margin: 0;
  display: grid;
  gap: 10px;
}

.rp-approval-item__facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rp-approval-item__facts dt {
  color: var(--text-muted);
  font-size: 11px;
}

.rp-approval-item__facts dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rp-approval-item__facts dd small {
  color: var(--text-faint);
  font-size: 11px;
}

.rp-approval-item__action {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* ---- 审批详情 --------------------------------------------------------- */
.rp-approval-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 4px solid var(--text-faint);
  background: linear-gradient(180deg, rgba(107, 114, 128, 0.04), var(--surface-solid));
}

.rp-approval-detail--pending  { border-top-color: var(--warning); background: linear-gradient(180deg, rgba(245, 158, 11, 0.05), var(--surface-solid)); }
.rp-approval-detail--executed { border-top-color: #16a34a;       background: linear-gradient(180deg, rgba(22, 163, 74, 0.05), var(--surface-solid)); }
.rp-approval-detail--rejected,
.rp-approval-detail--failed   { border-top-color: var(--danger); background: linear-gradient(180deg, rgba(245, 63, 63, 0.05), var(--surface-solid)); }
.rp-approval-detail--expired  { border-top-color: #94a3b8;       background: linear-gradient(180deg, rgba(148, 163, 184, 0.05), var(--surface-solid)); }

.rp-approval-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.rp-approval-detail__title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.rp-approval-detail__title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.rp-approval-detail__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.rp-approval-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 0;
}

.rp-approval-detail__grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.rp-approval-detail__grid dt {
  color: var(--text-muted);
  font-size: 11px;
}

.rp-approval-detail__grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.rp-approval-detail__summary {
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

.rp-approval-detail__notes {
  display: grid;
  gap: 8px;
}

.rp-approval-detail__note {
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.rp-approval-detail__note strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rp-approval-detail__note p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.rp-approval-detail__note--warn  { border-left: 3px solid var(--warning); }
.rp-approval-detail__note--error { border-left: 3px solid var(--danger); }

.rp-approval-detail__payload summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
}

.rp-approval-detail__payload pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.rp-approval-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rp-approval-actions__head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.rp-approval-actions__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.rp-approval-actions__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rp-approval-actions__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.rp-approval-actions__form strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.rp-approval-actions__form small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.rp-approval-actions__form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  box-sizing: border-box;
  resize: vertical;
}

.rp-approval-actions__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.rp-approval-actions__form--approve {
  border-left: 3px solid #16a34a;
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.04), var(--surface-solid));
}

.rp-approval-actions__form--reject {
  border-left: 3px solid var(--danger);
  background: linear-gradient(180deg, rgba(245, 63, 63, 0.04), var(--surface-solid));
}

/* ---- 移动端 720px ----------------------------------------------------- */
@media (max-width: 720px) {
  /* segmented control 在小屏自动 wrap */
  .rp-segmented { width: 100%; }
  .rp-segmented__item {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }
  .rp-relations { grid-template-columns: 1fr; }

  /* /roles 网格单列 */
  .rp-role-grid { grid-template-columns: 1fr; }
  .rp-role-card__title { flex-direction: column; align-items: flex-start; }

  /* form-shell 单列，aside 在下 */
  .rp-form-shell { grid-template-columns: 1fr; }
  .rp-form-stats { grid-template-columns: 1fr; }

  /* 业务域 nav 不 sticky（防遮挡） */
  .rp-domain-nav { position: static; }

  /* 业务域 section padding 给左侧色带 */
  .rp-domain-section { padding-left: 18px; }

  /* 动作行单列 */
  .rp-action {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* 策略项内部双列改单列 */
  .rp-policy-item__body { grid-template-columns: 1fr; }
  .rp-policy-user-grid {
    grid-template-columns: 1fr;
    max-height: 180px;
  }

  /* 审批项三列改纵向 */
  .rp-approval-item { grid-template-columns: 1fr; }
  .rp-approval-item__action { justify-content: stretch; }
  .rp-approval-item__action .rp-btn { width: 100%; }

  /* 审批详情双列改单列 */
  .rp-approval-actions__grid { grid-template-columns: 1fr; }
  .rp-approval-detail__head { flex-direction: column; }

  /* 按钮在小屏卡片内不挤 */
  .rp-role-card__actions { gap: 6px; }
}

/* =========================================================================
   售灯 / 供灯业务 — 移动优先 UI 重构（追加段）
   ---------------------------------------------------------------------------
   命名空间 .lamp-mf-* / .lamp-bp-* / .lamp-inv-mf-* / .lamp-wb2-*
   保持 PR base 字节不变，纯 LF 追加。
   桌面端 ≥768px 走表格 + 现有 .lamp-* 视觉；
   <768px 切换到任务卡 / 错误卡 / 库存卡。
   ========================================================================= */

/* ---- 默认：在大屏（≥768px）隐藏移动卡片，显示表格 ---------------------- */
.lamp-mf-mobile-list,
.lamp-bp-mobile-rows,
.lamp-inv-mf-list,
.lamp-inv-mf-flow {
  display: none;
}

.lamp-mf-desktop-only { display: block; }

/* ---- 工作台 v2：卡片更整齐，移动端 2 列 ------------------------------- */
.lamp-wb2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.lamp-wb2-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 88px;
}

.lamp-wb2-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.lamp-wb2-card__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.lamp-wb2-card__count {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lamp-wb2-card__note {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.45;
}

.lamp-wb2-card--pending    { border-top: 3px solid #6b7280; }
.lamp-wb2-card--accepted   { border-top: 3px solid var(--brand); }
.lamp-wb2-card--processing { border-top: 3px solid #245bdb; }
.lamp-wb2-card--due        { border-top: 3px solid var(--warning); }
.lamp-wb2-card--exception  { border-top: 3px solid var(--danger); }
.lamp-wb2-card--photo      { border-top: 3px solid #0ea5e9; }
.lamp-wb2-card--completed  { border-top: 3px solid #16a34a; }
.lamp-wb2-card--remark     { border-top: 3px solid #f59e0b; }
.lamp-wb2-card--modified   { border-top: 3px solid #8b5cf6; }
.lamp-wb2-card--stock      { border-top: 3px solid var(--danger); background: rgba(245, 63, 63, 0.03); }

/* 高亮异常 / 低库存数字 */
.lamp-wb2-card--exception .lamp-wb2-card__count,
.lamp-wb2-card--stock     .lamp-wb2-card__count { color: var(--danger); }
.lamp-wb2-card--due       .lamp-wb2-card__count { color: var(--warning); }
.lamp-wb2-card--completed .lamp-wb2-card__count { color: #16a34a; }

/* 工作台快捷入口 */
.lamp-wb2-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-soft);
}

.lamp-wb2-quick__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
  min-height: 56px;
}

.lamp-wb2-quick__item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.lamp-wb2-quick__item--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.lamp-wb2-quick__item--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.lamp-wb2-quick__item--primary .lamp-wb2-quick__body strong,
.lamp-wb2-quick__item--primary .lamp-wb2-quick__body small { color: #ffffff; }

.lamp-wb2-quick__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.lamp-wb2-quick__item--primary .lamp-wb2-quick__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.lamp-wb2-quick__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lamp-wb2-quick__body strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.lamp-wb2-quick__body small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---- 筛选区折叠按钮（桌面隐藏） --------------------------------------- */
.lamp-mf-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
  box-shadow: none;
}

.lamp-mf-toggle:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.lamp-mf-toggle__caret {
  font-size: 10px;
  transition: transform var(--transition);
}

.lamp-mf-toggle[aria-expanded="false"] .lamp-mf-toggle__caret {
  transform: rotate(-90deg);
}

/* ---- 订单任务卡（移动端） ---------------------------------------------- */
/* display 由顶部默认隐藏 + 768px 媒体查询统一控制。 */
.lamp-mf-mobile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 12px;
}

.lamp-mf-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.lamp-mf-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 12px 0 0 12px;
  background: var(--text-faint);
}

.lamp-mf-card--pending::before     { background: #94a3b8; }
.lamp-mf-card--accepted::before    { background: var(--brand); }
.lamp-mf-card--processing::before  { background: #245bdb; }
.lamp-mf-card--completed::before   { background: #16a34a; }
.lamp-mf-card--exception::before   { background: var(--danger); }
.lamp-mf-card--soon::before        { background: var(--warning); }
.lamp-mf-card--overdue::before     { background: var(--danger); background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,0.3) 4px, rgba(255,255,255,0.3) 8px); }

.lamp-mf-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lamp-mf-card__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lamp-mf-card__title strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.lamp-mf-card__title small {
  font-size: 12px;
  color: var(--text-muted);
}

.lamp-mf-card__status {
  flex-shrink: 0;
}

.lamp-mf-card__address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-all;
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: 6px;
}

.lamp-mf-card__addr-icon {
  flex-shrink: 0;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}

.lamp-mf-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lamp-mf-card__progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px dashed var(--border-soft);
  border-bottom: 1px dashed var(--border-soft);
}

.lamp-mf-card__progress > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lamp-mf-card__progress dt {
  font-size: 11px;
  color: var(--text-muted);
}

.lamp-mf-card__progress dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lamp-mf-card__progress dd strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lamp-mf-card__progress div:nth-child(3) { grid-column: 1 / -1; }

.lamp-mf-card__alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lamp-mf-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid transparent;
}

.lamp-mf-alert--photo {
  background: rgba(14, 165, 233, 0.08);
  color: #075985;
  border-color: rgba(14, 165, 233, 0.22);
}

.lamp-mf-alert--remark {
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.28);
  flex-direction: column;
  gap: 2px;
}

.lamp-mf-alert--remark strong {
  font-size: 12px;
  font-weight: 700;
}

.lamp-mf-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lamp-mf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  box-shadow: none;
  min-width: 0;
  flex: 1 1 auto;
}

.lamp-mf-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.lamp-mf-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
}

.lamp-mf-btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.lamp-mf-empty {
  text-align: center;
}

.lamp-mf-empty__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---- 新增订单表单分组 -------------------------------------------------- */
.lamp-mf-form-panel { background: linear-gradient(180deg, rgba(51, 112, 255, 0.03), var(--surface-solid)); }

.lamp-mf-form-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.lamp-mf-form-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.lamp-mf-form-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

.lamp-mf-form-lead strong {
  color: var(--brand-strong);
  font-weight: 600;
}

.lamp-mf-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lamp-mf-section {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface-solid);
}

.lamp-mf-section--customer { border-left: 4px solid var(--brand); }
.lamp-mf-section--plan     { border-left: 4px solid #16a34a; }
.lamp-mf-section--execution{ border-left: 4px solid #f59e0b; }

.lamp-mf-section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.lamp-mf-section__title small {
  width: 100%;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.lamp-mf-section__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.lamp-mf-section--plan      .lamp-mf-section__step { background: #16a34a; }
.lamp-mf-section--execution .lamp-mf-section__step { background: #f59e0b; }

.lamp-mf-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lamp-mf-section__grid > .field.full { grid-column: 1 / -1; }

.lamp-mf-required {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 63, 63, 0.10);
  color: #b91c1c;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.lamp-mf-photo-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-direction: column;
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

.lamp-mf-photo-check > input[type="checkbox"] + span {
  font-weight: 500;
}

.lamp-mf-advanced {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
}

.lamp-mf-advanced__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.lamp-mf-advanced__summary::-webkit-details-marker { display: none; }

.lamp-mf-advanced__summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.lamp-mf-advanced[open] .lamp-mf-advanced__summary { color: var(--text); }
.lamp-mf-advanced[open] .lamp-mf-advanced__summary::after { transform: rotate(180deg); }

.lamp-mf-advanced__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-solid);
  color: var(--text-muted);
  font-size: 14px;
  border: 1px solid var(--border);
}

.lamp-mf-advanced[open] .lamp-mf-section__grid {
  margin-top: 12px;
}

.lamp-mf-info {
  margin: 0;
}

.lamp-mf-form-actions {
  display: flex;
  justify-content: flex-end;
}

.lamp-mf-submit {
  padding: 0 28px;
  height: 44px;
  font-weight: 600;
  font-size: 15px;
  min-width: 200px;
}

/* ---- 批量预检查页面 ---------------------------------------------------- */
.lamp-bp-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 4px solid var(--brand);
}

.lamp-bp-hero--ok      { border-top-color: #16a34a; background: linear-gradient(180deg, rgba(22,163,74,0.04), var(--surface-solid)); }
.lamp-bp-hero--danger  { border-top-color: var(--danger); background: linear-gradient(180deg, rgba(245,63,63,0.04), var(--surface-solid)); }

.lamp-bp-hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lamp-bp-hero__eyebrow {
  font-size: 11px;
  color: var(--brand-strong);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.lamp-bp-hero__title {
  margin: 4px 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.lamp-bp-hero__sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.lamp-bp-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lamp-bp-summary__card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lamp-bp-summary__card span {
  font-size: 12px;
  color: var(--text-muted);
}

.lamp-bp-summary__card strong {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lamp-bp-summary__card em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
}

.lamp-bp-summary__card--total { border-top: 3px solid var(--brand); }
.lamp-bp-summary__card--ok    { border-top: 3px solid #16a34a; }
.lamp-bp-summary__card--ok strong { color: #15803d; }
.lamp-bp-summary__card--err   { border-top: 3px solid var(--danger); background: rgba(245, 63, 63, 0.04); }
.lamp-bp-summary__card--err strong { color: var(--danger); }
.lamp-bp-summary__card--zero  { border-top: 3px solid var(--border-strong); }
.lamp-bp-summary__card--zero strong { color: var(--text-muted); }

.lamp-bp-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lamp-bp-block--danger { border-color: rgba(245, 63, 63, 0.30); background: rgba(245, 63, 63, 0.04); }
.lamp-bp-block--ok     { border-color: rgba(22, 163, 74, 0.30); background: rgba(22, 163, 74, 0.04); }

.lamp-bp-block__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.lamp-bp-block__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

.lamp-bp-block--danger .lamp-bp-block__icon { background: var(--danger); }
.lamp-bp-block--ok     .lamp-bp-block__icon { background: #16a34a; }

.lamp-bp-block__head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.lamp-bp-block__head p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.lamp-bp-block__head p strong { color: var(--text); font-weight: 600; }

.lamp-bp-block__form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.lamp-bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  min-width: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.lamp-bp-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.lamp-bp-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.lamp-bp-btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #ffffff; }

.lamp-bp-btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(245, 63, 63, 0.25);
}

.lamp-bp-btn--danger:hover {
  background: #c92020;
  border-color: #c92020;
  color: #ffffff;
}

.lamp-bp-btn--ghost { background: transparent; }

.lamp-bp-risk-check {
  padding: 12px 14px;
  background: rgba(245, 63, 63, 0.04);
  border: 1px dashed rgba(245, 63, 63, 0.35);
  border-radius: 8px;
}

.lamp-bp-risk-check span { font-weight: 600; color: var(--text); }

.lamp-bp-confirm-actions { gap: 10px; }

.lamp-bp-rows-head {
  margin-bottom: 12px;
}

.lamp-bp-rows-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.lamp-bp-rows-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.lamp-bp-table tbody tr.lamp-bp-row--err > td { background: rgba(245, 63, 63, 0.04); }
.lamp-bp-table tbody tr.lamp-bp-row--warn > td { background: rgba(245, 158, 11, 0.04); }

/* display 由顶部默认隐藏 + 768px 媒体查询统一控制。 */
.lamp-bp-mobile-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 10px;
}

.lamp-bp-row-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 4px solid var(--border);
}

.lamp-bp-row-card--err  { border-left-color: var(--danger); background: rgba(245, 63, 63, 0.03); }
.lamp-bp-row-card--warn { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.03); }
.lamp-bp-row-card--ok   { border-left-color: #16a34a; }

.lamp-bp-row-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.lamp-bp-row-card__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.lamp-bp-row-card__line {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.lamp-bp-row-card__title strong {
  font-size: 14px;
  color: var(--text);
}

.lamp-bp-row-card__state {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--text-muted);
}

.lamp-bp-row-card__state--err  { background: rgba(245, 63, 63, 0.12); color: #b91c1c; }
.lamp-bp-row-card__state--warn { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.lamp-bp-row-card__state--ok   { background: rgba(22, 163, 74, 0.12); color: #15803d; }

.lamp-bp-row-card__facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.lamp-bp-row-card__facts > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  font-size: 12px;
  align-items: baseline;
}

.lamp-bp-row-card__facts dt { color: var(--text-muted); }

.lamp-bp-row-card__facts dd {
  margin: 0;
  color: var(--text);
  word-break: break-all;
}

.lamp-bp-row-card__facts dd small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-faint);
}

.lamp-bp-row-card__note {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.lamp-bp-row-card__note--err  { background: rgba(245, 63, 63, 0.08);  border: 1px solid rgba(245, 63, 63, 0.25); }
.lamp-bp-row-card__note--warn { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.25); }

.lamp-bp-row-card__note strong {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.lamp-bp-row-card__note ul {
  margin: 0 0 4px;
  padding-left: 18px;
}

.lamp-bp-row-card__note li {
  margin: 2px 0;
}

.lamp-bp-row-card__hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ---- 库存页移动卡片 --------------------------------------------------- */
/* display 由顶部默认隐藏 + 768px 媒体查询统一控制。 */
.lamp-inv-mf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 12px;
}

.lamp-inv-mf-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid #16a34a;
}

.lamp-inv-mf-card--low      { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.03); }
.lamp-inv-mf-card--archived { border-left-color: var(--text-faint); background: var(--surface-muted); opacity: 0.85; }

.lamp-inv-mf-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lamp-inv-mf-card__head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.lamp-inv-mf-card__head strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.lamp-inv-mf-card__head small {
  font-size: 11px;
  color: var(--text-muted);
}

.lamp-inv-mf-card__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.lamp-inv-mf-card__facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.lamp-inv-mf-card__notes { grid-column: 1 / -1; }

.lamp-inv-mf-card__facts dt {
  font-size: 11px;
  color: var(--text-muted);
}

.lamp-inv-mf-card__facts dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.lamp-inv-mf-card__facts dd strong {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.lamp-inv-mf-card__low { color: var(--warning) !important; }

.lamp-inv-mf-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

.lamp-inv-mf-adjust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.lamp-inv-mf-adjust select,
.lamp-inv-mf-adjust input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}

.lamp-inv-mf-adjust button {
  grid-column: 1 / -1;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
}

.lamp-inv-mf-card__row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lamp-inv-mf-card__row-actions form { margin: 0; flex: 1 1 auto; }

.lamp-inv-mf-card__row-actions button {
  width: 100%;
  min-height: 36px;
  font-size: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
}

.lamp-inv-mf-card__row-actions .lamp-inv-mf-danger {
  background: rgba(245, 63, 63, 0.06);
  border-color: rgba(245, 63, 63, 0.28);
  color: var(--danger);
}

.lamp-inv-mf-card__hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* display 由顶部默认隐藏 + 768px 媒体查询统一控制。 */
.lamp-inv-mf-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.lamp-inv-mf-flow__item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid var(--text-faint);
}

.lamp-inv-mf-flow__item--up   { border-left-color: #16a34a; }
.lamp-inv-mf-flow__item--down { border-left-color: var(--danger); }

.lamp-inv-mf-flow__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lamp-inv-mf-flow__head small {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.lamp-inv-mf-flow__product {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.lamp-inv-mf-flow__delta {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.lamp-inv-mf-flow__item--up   .lamp-inv-mf-flow__delta { color: #15803d; }
.lamp-inv-mf-flow__item--down .lamp-inv-mf-flow__delta { color: var(--danger); }

.lamp-inv-mf-flow__delta small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.lamp-inv-mf-flow__remark {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- 平板 768px ------------------------------------------------------- */
@media (max-width: 1024px) {
  .lamp-mf-section__grid { grid-template-columns: 1fr; }
  .lamp-bp-summary { grid-template-columns: 1fr 1fr; }
  .lamp-bp-summary__card--err { grid-column: 1 / -1; }
}

/* ---- 手机 768px 切换：隐藏表格，显示卡片 ----------------------------- */
@media (max-width: 768px) {
  .lamp-mf-desktop-only { display: none !important; }
  .lamp-mf-mobile-list,
  .lamp-bp-mobile-rows,
  .lamp-inv-mf-list,
  .lamp-inv-mf-flow {
    display: grid;
  }

  /* 筛选区折叠 */
  .lamp-mf-toggle { display: inline-flex; }
  .lamp-mf-filter-body[aria-hidden="true"] { display: none; }

  /* 工作台卡片在手机上 2 列 */
  .lamp-wb2-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lamp-wb2-card { min-height: 76px; padding: 10px 12px; }
  .lamp-wb2-card__count { font-size: 22px; }
  .lamp-wb2-quick { grid-template-columns: 1fr; }

  /* 工作流步骤 + 状态筛选 chip 紧凑 */
  .lamp-workflow-steps { font-size: 11px; gap: 4px 10px; padding: 8px 10px; }
  .lamp-filter-bar { gap: 4px; }
  .lamp-filter-chip { font-size: 12px; padding: 0 10px; min-height: 36px; }

  /* 批量预检查摘要 */
  .lamp-bp-summary { grid-template-columns: 1fr; }
  .lamp-bp-summary__card strong { font-size: 28px; }
  .lamp-bp-block__head { flex-direction: column; gap: 8px; }

  /* 新增订单 sticky 提交按钮 */
  .lamp-mf-form-actions {
    position: sticky;
    bottom: 12px;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, var(--surface-solid) 30%);
    padding: 16px 0 8px;
    margin-top: 8px;
  }
  .lamp-mf-submit { width: 100%; min-width: 0; }

  /* 库存调整网格 */
  .lamp-inv-mf-adjust { grid-template-columns: 1fr; }

  /* 来源渠道 select 在 mobile 单独成行 */
  .lamp-source-filter { width: 100%; }
  .lamp-source-filter label { display: flex; flex-direction: column; width: 100%; gap: 4px; }
  .lamp-source-filter select { width: 100%; min-height: 40px; }
}

/* ---- 大屏手机 430px ----------------------------------------------------*/
@media (max-width: 430px) {
  .lamp-wb2-grid { grid-template-columns: 1fr 1fr; }
  .lamp-bp-row-card__facts > div { grid-template-columns: 80px minmax(0, 1fr); }
}

/* ---- 小手机 390px ----------------------------------------------------- */
@media (max-width: 390px) {
  /* 让卡片紧凑一点但仍可读 */
  .lamp-mf-card { padding: 12px 12px 10px; }
  .lamp-mf-card__title strong { font-size: 15px; }
  .lamp-mf-card__progress { grid-template-columns: 1fr; }
  .lamp-mf-card__progress div:nth-child(3) { grid-column: 1; }

  .lamp-wb2-card__count { font-size: 20px; }
  .lamp-wb2-card { padding: 10px; min-height: 70px; }

  .lamp-bp-row-card__facts > div { grid-template-columns: 70px minmax(0, 1fr); font-size: 11.5px; }

  /* 售灯详情 hero metrics 改单列 */
  .lamp-detail-hero__metrics { grid-template-columns: 1fr 1fr; gap: 10px 14px; }

  .lamp-mf-section { padding: 12px; }
  .lamp-mf-section__step { width: 22px; height: 22px; font-size: 11px; }
}

/* =========================================================================
   售灯订单表格 — 桌面端列宽修复（防 CJK 字符竖排）
   ---------------------------------------------------------------------------
   问题：1440 桌面侧边栏展开时，main 区可用宽 ~1160px，14 列表格被压缩
        导致 "孙女士" / "厦门市思明区海安路" / 备注文本竖排（每字 1 列宽）。
   方案：表格设最低宽度（小于该宽度由 .table-wrap overflow-x 滚动），
        给关键列加 min-width 让 CJK 文本有足够空间，
        购买人 cell-strong / 状态 chip / 来源 chip 单元用 nowrap。
   ========================================================================= */

/* 整表最低宽度：CJK 14 列正常呈现所需 */
.lamp-task-table {
  min-width: 1280px;
  table-layout: auto;
}

/* 购买人列：包含姓名 + 备注内联，最小给 120 让姓名不竖排 */
.lamp-task-table thead th:nth-child(1),
.lamp-task-table tbody td:nth-child(1) {
  min-width: 120px;
}

/* 地址列：最小给 140 让"厦门市思明区"等 CJK 短地址不竖排，长地址再 break-word */
.lamp-task-table thead th:nth-child(2),
.lamp-task-table tbody td:nth-child(2) {
  min-width: 140px;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 来源渠道：80（chip 内容） */
.lamp-task-table thead th:nth-child(3),
.lamp-task-table tbody td:nth-child(3) {
  min-width: 88px;
  white-space: nowrap;
}

/* 分组 / 活动：96（chip + 短中文） */
.lamp-task-table thead th:nth-child(4),
.lamp-task-table tbody td:nth-child(4) {
  min-width: 96px;
}

/* 祈愿类型：88（短中文） */
.lamp-task-table thead th:nth-child(5),
.lamp-task-table tbody td:nth-child(5) {
  min-width: 88px;
}

/* 当前轮灯规格：130（"30天莲花灯" + 注释一行） */
.lamp-task-table thead th:nth-child(6),
.lamp-task-table tbody td:nth-child(6) {
  min-width: 130px;
}

/* 数量 num：保持 nowrap */
.lamp-task-table thead th:nth-child(7),
.lamp-task-table tbody td:nth-child(7) {
  min-width: 60px;
}

/* 已完成 / 购买总天数 num */
.lamp-task-table thead th:nth-child(8),
.lamp-task-table tbody td:nth-child(8) {
  min-width: 110px;
}

/* 实际供灯天数 num */
.lamp-task-table thead th:nth-child(9),
.lamp-task-table tbody td:nth-child(9) {
  min-width: 96px;
}

/* 赠送天数 num */
.lamp-task-table thead th:nth-child(10),
.lamp-task-table tbody td:nth-child(10) {
  min-width: 80px;
}

/* 当前轮到期 */
.lamp-task-table thead th:nth-child(11),
.lamp-task-table tbody td:nth-child(11) {
  min-width: 110px;
  white-space: nowrap;
}

/* 执行负责人 */
.lamp-task-table thead th:nth-child(12),
.lamp-task-table tbody td:nth-child(12) {
  min-width: 96px;
}

/* 状态 chip */
.lamp-task-table thead th:nth-child(13),
.lamp-task-table tbody td:nth-child(13) {
  min-width: 80px;
  white-space: nowrap;
}

/* 详情链接 */
.lamp-task-table thead th:nth-child(14),
.lamp-task-table tbody td:nth-child(14) {
  min-width: 64px;
  white-space: nowrap;
}

/* cell-strong（购买人姓名）：不允许竖排 */
.lamp-task-table .cell-strong {
  white-space: nowrap;
}

/* cell-sub（时间戳、灯规格备注）：可换行但不强制按字符断 */
.lamp-task-table .cell-sub {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 备注 inline：宽度限制内允许换行（CJK + 标点正常断行） */
.lamp-remark-inline {
  word-break: break-word;
  overflow-wrap: break-word;
}

.lamp-remark-inline small {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 已有的 lamp-group-tag 全局 break-all 在表格内不需要：让分组用 keep-all */
.lamp-task-table .lamp-group-tag {
  white-space: nowrap;
  word-break: keep-all;
}

/* 状态 chip 在表格内不要竖排 */
.lamp-task-table .lamp-status-chip,
.lamp-task-table .chip {
  white-space: nowrap;
}

/* 768px 移动端：表格隐藏（已由 .lamp-mf-desktop-only 控制），
   但保险起见把 min-width 重置，避免任何残留 wrap 撑爆。 */
@media (max-width: 768px) {
  .lamp-task-table {
    min-width: 0;
  }
}

/* 香灯照片审核与售香补充页面 */
.photo-grid,
.photo-review-list {
  display: grid;
  gap: 16px;
}

.photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.photo-card,
.photo-review-item {
  border: 1px solid var(--line-soft, #e5e7eb);
  border-radius: 12px;
  background: #fff;
}

.photo-card {
  padding: 12px;
}

.photo-card img,
.photo-review-image img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line-soft, #e5e7eb);
}

.photo-review-item {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  padding: 18px;
}

.photo-review-info h3 {
  font-size: 28px;
  line-height: 1.2;
  margin: 10px 0 14px;
}

.photo-review-image {
  display: grid;
  align-content: start;
  gap: 10px;
}

@media (max-width: 768px) {
  .photo-review-item {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

/* =========================================================================
   香灯业务 incense-lamp 移动优先 UI 重构 — 追加段
   ---------------------------------------------------------------------------
   命名空间 .il-* （incense-lamp）独立于已有 .lamp-* / .rp-*。
   显示控制：.il-desktop-only 桌面端显示，.il-mobile-list 默认隐藏；
            @media (max-width: 768px) 切换。
   ========================================================================= */

/* ---- 默认显示控制 ----------------------------------------------------- */
.il-desktop-only { display: block; }
.il-mobile-list { display: none; }

/* ---- 通用按钮 / 标签 / 提示 ------------------------------------------ */
.il-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  box-shadow: none;
  min-width: 0;
}

.il-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.il-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
  min-height: 44px;
  padding: 0 18px;
}

.il-btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.il-btn--ghost {
  background: transparent;
}

.il-submit {
  min-height: 44px;
  padding: 0 24px;
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.il-submit:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.il-required {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 63, 63, 0.10);
  color: #b91c1c;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
}

.il-hint {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.il-order-no {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.il-group-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-xs);
  background: rgba(51, 112, 255, 0.08);
  color: #245bdb;
  font-size: 12px;
  font-weight: 600;
  word-break: break-all;
  max-width: 100%;
}

.il-remark-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
}

.il-aliases {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.il-share-url {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  max-width: 100%;
}

.il-share-link-cell {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.il-share-link-cell .il-share-url {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.il-photo-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.il-photo-chip--ok   { background: rgba(22, 163, 74, 0.12);  color: #15803d; border-color: rgba(22, 163, 74, 0.28); }
.il-photo-chip--warn { background: rgba(245, 158, 11, 0.14); color: #b45309; border-color: rgba(245, 158, 11, 0.32); }
.il-photo-chip--off  { background: var(--surface-muted);     color: var(--text-muted); }

/* ---- 售香列表桌面表格增强 ------------------------------------------- */
.il-table {
  width: 100%;
}

.il-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.il-table th.num,
.il-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.il-table--incense {
  min-width: 1000px;
}

.il-table--channels {
  min-width: 900px;
}

.il-channel-create-form {
  margin: 16px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
}

.il-channel-actions {
  min-width: 220px;
}

.il-channel-actions,
.il-card__actions .il-inline-edit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.il-inline-edit {
  min-width: 0;
}

.il-inline-edit summary {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--brand);
  background: var(--surface-solid);
  cursor: pointer;
  font-weight: 600;
  list-style-position: inside;
}

.il-inline-edit[open] {
  flex-basis: 100%;
}

.il-inline-edit[open] summary {
  margin-bottom: 10px;
}

.il-inline-edit .form-grid {
  min-width: min(560px, 100%);
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.il-row > td { vertical-align: middle; }

.il-row:hover > td { background: rgba(51, 112, 255, 0.04); }
.il-row--exception > td { background: rgba(245, 63, 63, 0.04); }
.il-row--completed > td { color: var(--text-muted); }
.il-row--archived > td { color: var(--text-muted); }

.il-cell-remark {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.il-cell-remark small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.il-list-filter {
  align-items: center;
  gap: 8px;
}

.il-list-filter__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.il-list-filter__check {
  margin: 0;
}

.il-list-panel { position: relative; }

/* ---- 售香列表移动卡 ------------------------------------------------- */
.il-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.il-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 12px 0 0 12px;
  background: var(--text-faint);
}

.il-card--pending::before    { background: #94a3b8; }
.il-card--accepted::before   { background: var(--brand); }
.il-card--processing::before { background: #245bdb; }
.il-card--completed::before  { background: #16a34a; }
.il-card--exception::before  { background: var(--danger); }
.il-card--archived::before   { background: #9ca3af; }
.il-card--channel::before    { background: var(--brand); }
.il-card--share::before      { background: #8b5cf6; }
.il-card--archived           { background: var(--surface-muted); }

.il-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.il-card__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.il-card__title strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.il-card__title small {
  font-size: 12px;
  color: var(--text-muted);
}

.il-card__order {
  align-self: flex-start;
}

.il-card__address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: 6px;
  line-height: 1.55;
  word-break: break-all;
}

.il-card__addr-icon {
  flex-shrink: 0;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}

.il-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.il-card__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px dashed var(--border-soft);
}

.il-card__facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.il-card__facts-wide { grid-column: 1 / -1; }

.il-card__facts dt {
  font-size: 11px;
  color: var(--text-muted);
}

.il-card__facts dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

.il-card__alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.il-card__remark {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #92400e;
  font-size: 12px;
  line-height: 1.55;
}

.il-card__remark strong { font-size: 12px; font-weight: 700; }

.il-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.il-card__actions .il-btn,
.il-card__actions form { flex: 1 1 auto; }
.il-card__actions form button { width: 100%; }

.il-empty { text-align: center; }
.il-empty__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---- 新增售香 / 共用表单分组 ---------------------------------------- */
.il-form-panel { background: linear-gradient(180deg, rgba(51, 112, 255, 0.03), var(--surface-solid)); }

.il-form-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.il-form-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.il-form-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

.il-form-lead strong { color: var(--brand-strong); font-weight: 600; }

.il-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.il-section {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface-solid);
}

.il-section--customer  { border-left: 4px solid var(--brand); }
.il-section--plan      { border-left: 4px solid #16a34a; }
.il-section--execution { border-left: 4px solid #f59e0b; }

.il-section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.il-section__title small {
  width: 100%;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 2px;
}

.il-section__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.il-section--plan      .il-section__step { background: #16a34a; }
.il-section--execution .il-section__step { background: #f59e0b; }

.il-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.il-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.il-field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.il-field--wide { grid-column: 1 / -1; }

.il-field input,
.il-field select,
.il-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-solid);
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.il-field textarea {
  min-height: 80px;
  line-height: 1.55;
  resize: vertical;
}

.il-field input:focus,
.il-field select:focus,
.il-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.il-photo-check {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  cursor: pointer;
}

.il-photo-check > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.il-photo-check > span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.il-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ---- 售香详情 hero --------------------------------------------------- */
.il-detail-hero {
  border-top: 4px solid var(--brand);
  padding: 20px 22px 18px;
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.05), var(--surface-solid));
}

.il-detail-hero--pending    { border-top-color: #94a3b8;     background: linear-gradient(180deg, rgba(148, 163, 184, 0.06), var(--surface-solid)); }
.il-detail-hero--accepted   { border-top-color: var(--brand); background: linear-gradient(180deg, rgba(51, 112, 255, 0.05), var(--surface-solid)); }
.il-detail-hero--processing { border-top-color: #245bdb;     background: linear-gradient(180deg, rgba(36, 91, 219, 0.05), var(--surface-solid)); }
.il-detail-hero--completed  { border-top-color: #16a34a;     background: linear-gradient(180deg, rgba(22, 163, 74, 0.05), var(--surface-solid)); }
.il-detail-hero--exception  { border-top-color: var(--danger); background: linear-gradient(180deg, rgba(245, 63, 63, 0.05), var(--surface-solid)); }

.il-detail-hero__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}

.il-detail-hero__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.il-detail-hero__title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.il-detail-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.il-detail-hero__meta strong { color: var(--text); font-weight: 600; }

.il-detail-hero__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
}

.il-hero-metric {
  display: grid;
  gap: 4px;
}

.il-hero-metric__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.il-hero-metric__value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.il-hero-metric__value em {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.il-hero-metric__value--text {
  font-size: 17px;
  line-height: 1.35;
  word-break: break-all;
}

.il-hero-metric__note {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

.il-remark-panel {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), var(--surface-solid));
  border-color: rgba(245, 158, 11, 0.28);
}

.il-remark-panel p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.il-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
}

.il-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
}

.il-detail-grid > div > span.muted { font-size: 12px; }
.il-detail-grid > div > strong { font-weight: 500; color: var(--text); word-break: break-all; }

.il-warn-note { margin-top: 8px; }

/* ---- 售香详情：流程操作 ---------------------------------------------- */
.il-action-intro {
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.05), var(--surface-solid));
  border-color: rgba(51, 112, 255, 0.18);
}

.il-action-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.il-action-card { border-color: var(--border); }
.il-action-card--primary {
  border-left: 3px solid var(--brand);
  background: linear-gradient(180deg, rgba(51, 112, 255, 0.04), var(--surface-solid));
}
.il-action-card--exception {
  border-left: 3px solid var(--danger);
  background: linear-gradient(180deg, rgba(245, 63, 63, 0.03), var(--surface-solid));
}

.il-action-step {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 600;
}

.il-action-step--exception {
  background: rgba(245, 63, 63, 0.10);
  color: var(--danger);
}

.il-primary-action {
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  font-weight: 600;
  min-height: 44px;
}

.il-primary-action:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

/* ---- 售香详情：照片区 ----------------------------------------------- */
.il-photo-panel {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.03), var(--surface-solid));
}

.il-photo-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(22, 163, 74, 0.22);
}

.il-photo-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface-solid);
  margin-bottom: 12px;
}

.il-photo-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.il-photo-form__grid > .il-field--wide { grid-column: 1 / -1; }

.il-photo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.il-photo-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  overflow: hidden;
}

.il-photo-card__img {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
  overflow: hidden;
}

.il-photo-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.il-photo-card__img:hover img { transform: scale(1.04); }

.il-photo-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.il-photo-card__row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.il-photo-card__desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  word-break: break-word;
}

/* ---- 批量入口 .il-batch-* ------------------------------------------- */
.il-batch-panel { background: linear-gradient(180deg, rgba(51, 112, 255, 0.03), var(--surface-solid)); }

.il-batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.il-tool {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  min-width: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.il-tool:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.il-tool--export     { border-left: 3px solid #16a34a; }
.il-tool--order      { border-left: 3px solid var(--brand); }
.il-tool--completion { border-left: 3px solid #f59e0b; }

.il-tool__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.il-tool__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
}

.il-tool--export     .il-tool__icon { background: rgba(22, 163, 74, 0.12);  color: #15803d; }
.il-tool--completion .il-tool__icon { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.il-tool__head h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.il-tool__head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.il-tool__file {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
}

.il-tool__file-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.il-tool__file input[type="file"] {
  width: 100%;
  padding: 6px 0;
  font-size: 13px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text);
}

.il-tool__file input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 0 12px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.il-tool__file input[type="file"]::file-selector-button:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.il-tool__hint {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(51, 112, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid rgba(51, 112, 255, 0.18);
}

.il-tool__action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.il-tool__btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

.il-tool__btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.il-tool__btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.il-tool__btn--ghost { background: transparent; flex: 0 0 auto; }

/* ---- 照片审核工作台 -------------------------------------------------- */
.il-pr-intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.il-pr-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(51, 112, 255, 0.05);
  border: 1px solid rgba(51, 112, 255, 0.22);
}

.il-pr-tip__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.il-pr-tip strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.il-pr-tip p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.il-pr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.il-pr-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 18px;
  padding: 18px;
  align-items: flex-start;
  scroll-margin-top: 96px;
}

.il-pr-item__info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.il-pr-item__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.il-pr-item__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.il-pr-item__facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}

.il-pr-item__facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.il-pr-item__facts dt {
  font-size: 11px;
  color: var(--text-muted);
}

.il-pr-item__facts dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

.il-pr-item__remark {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #92400e;
  font-size: 13px;
  line-height: 1.55;
}

.il-pr-item__remark strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 4px;
}

.il-pr-item__remark p { margin: 0; word-break: break-word; }

.il-pr-item__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.il-pr-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  margin: 0;
}

.il-pr-action--approve {
  border-left: 3px solid #16a34a;
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.04), var(--surface-solid));
}

.il-pr-action--reject {
  border-left: 3px solid var(--danger);
  background: linear-gradient(180deg, rgba(245, 63, 63, 0.04), var(--surface-solid));
}

.il-pr-reject-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.il-pr-reject-label input {
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}

.il-pr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.il-pr-btn--primary {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.il-pr-btn--primary:hover {
  background: #15803d;
  border-color: #15803d;
}

.il-pr-btn--danger-ghost {
  background: transparent;
  border-color: rgba(245, 63, 63, 0.40);
  color: var(--danger);
}

.il-pr-btn--danger-ghost:hover {
  background: rgba(245, 63, 63, 0.06);
}

.il-pr-item__photo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.il-pr-photo-link {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.il-pr-photo-link img {
  width: 100%;
  display: block;
  max-height: 480px;
  object-fit: contain;
  background: #0f172a;
}

.il-pr-photo-zoom {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.il-pr-photo-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- 外部链接管理 panel ---------------------------------------------- */
.il-share-panel { background: linear-gradient(180deg, rgba(139, 92, 246, 0.04), var(--surface-solid)); }

/* ---- 移动端 768 ------------------------------------------------------ */
@media (max-width: 768px) {
  .il-desktop-only { display: none !important; }
  .il-mobile-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }

  .il-section__grid { grid-template-columns: 1fr; }
  .il-photo-form__grid { grid-template-columns: 1fr; }

  .il-form__actions {
    position: sticky;
    bottom: 12px;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, var(--surface-solid) 30%);
    padding: 14px 0 6px;
    margin-top: 4px;
  }

  .il-submit { width: 100%; min-width: 0; }

  .il-list-filter {
    flex-wrap: wrap;
    width: 100%;
  }
  .il-list-filter__label,
  .il-list-filter__check { width: 100%; }
  .il-list-filter__label select { width: 100%; min-height: 40px; }

  /* 售香详情 hero metrics 改 2 列 */
  .il-detail-hero { padding: 16px 14px 14px; }
  .il-detail-hero__title h3 { font-size: 18px; }
  .il-detail-hero__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .il-hero-metric__value { font-size: 18px; }
  .il-hero-metric__value--text { font-size: 15px; }

  /* 流程操作单列 */
  .il-action-grid { grid-template-columns: 1fr; }

  /* 批量入口工具卡单列 */
  .il-batch-grid { grid-template-columns: 1fr; gap: 10px; }
  .il-tool { padding: 14px; }
  .il-tool__action { flex-direction: column; align-items: stretch; }
  .il-tool__btn { width: 100%; }

  /* 审核对比改单列 */
  .il-pr-item { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .il-pr-item__photo { order: -1; }  /* 移动端把照片放上面更直观 */
  .il-pr-item__head h3 { font-size: 16px; }
  .il-pr-photo-link img { max-height: 60vh; }

  /* 详情 grid 单列 */
  .il-detail-grid { grid-template-columns: 1fr; }

  /* 香品 / 渠道表格让 .table-wrap 滚动；卡片由 .il-mobile-list 接管 */
  .il-table--incense,
  .il-table--channels { min-width: 0; }
}

@media (max-width: 430px) {
  .il-batch-grid,
  .il-photo-grid { gap: 10px; }
  .il-photo-grid { grid-template-columns: 1fr 1fr; }
  .il-section { padding: 12px; }
  .il-section__step { width: 22px; height: 22px; font-size: 11px; }
}

@media (max-width: 390px) {
  .il-card { padding: 12px 12px 10px; }
  .il-card__title strong { font-size: 15px; }
  .il-card__facts { grid-template-columns: 1fr; }
  .il-pr-item__facts { grid-template-columns: 1fr; }
  .il-detail-hero__metrics { grid-template-columns: 1fr; }
  .il-photo-grid { grid-template-columns: 1fr; }
}

/* Smart order fill: local text parser preview for lamp/incense creation. */
.lamp-smart-fill {
  display: grid;
  gap: 16px;
  border-left: 4px solid var(--primary);
}

.lamp-smart-fill__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.lamp-smart-fill__header h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.lamp-smart-fill__header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.lamp-smart-fill__badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.lamp-smart-fill__input {
  display: grid;
  gap: 8px;
  font-weight: 800;
  color: var(--text-main);
}

.lamp-smart-fill__input textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.65;
}

.lamp-smart-fill__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lamp-smart-fill__actions button {
  min-height: 42px;
}

.lamp-smart-fill__actions small {
  color: var(--text-muted);
}

.lamp-smart-fill__status {
  min-height: 22px;
  color: var(--text-muted);
  font-weight: 700;
}

.lamp-smart-fill__status.is-error { color: #b91c1c; }
.lamp-smart-fill__status.is-success { color: #047857; }
.lamp-smart-fill__status.is-info { color: #1d4ed8; }

.lamp-smart-fill__results {
  display: grid;
  gap: 12px;
}

.lamp-smart-fill__summary {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-weight: 800;
}

.lamp-smart-fill__warnings {
  margin: 0;
  padding: 10px 12px 10px 30px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-weight: 700;
}

.lamp-smart-fill__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.lamp-smart-fill__field {
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.lamp-smart-fill__field.is-needs_confirm {
  border-color: #f59e0b;
  background: #fffbeb;
}

.lamp-smart-fill__field.is-missing {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: var(--text-muted);
}

.lamp-smart-fill__field-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.lamp-smart-fill__field-head strong {
  font-size: 13px;
}

.lamp-smart-fill__field-head span {
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  background: #eef2ff;
  color: #4338ca;
  white-space: nowrap;
}

.lamp-smart-fill__field.is-needs_confirm .lamp-smart-fill__field-head span {
  background: #fef3c7;
  color: #92400e;
}

.lamp-smart-fill__field.is-missing .lamp-smart-fill__field-head span {
  background: #e5e7eb;
  color: #4b5563;
}

.lamp-smart-fill__field p {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.lamp-smart-fill__field small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  line-height: 1.5;
}

.lamp-smart-fill__results[hidden] {
  display: none;
}

.smart-fill-inline-hint {
  display: block;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid #e2e8f0;
}

.smart-fill-inline-hint.is-high {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.smart-fill-inline-hint.is-needs_confirm {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}

.smart-fill-inline-hint.is-missing {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.field.smart-fill-field-high input,
.field.smart-fill-field-high select,
.field.smart-fill-field-high textarea,
.il-field.smart-fill-field-high input,
.il-field.smart-fill-field-high select,
.il-field.smart-fill-field-high textarea {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
}

.field.smart-fill-field-needs_confirm input,
.field.smart-fill-field-needs_confirm select,
.field.smart-fill-field-needs_confirm textarea,
.il-field.smart-fill-field-needs_confirm input,
.il-field.smart-fill-field-needs_confirm select,
.il-field.smart-fill-field-needs_confirm textarea,
.field.smart-fill-field-missing input,
.field.smart-fill-field-missing select,
.field.smart-fill-field-missing textarea,
.il-field.smart-fill-field-missing input,
.il-field.smart-fill-field-missing select,
.il-field.smart-fill-field-missing textarea {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.14);
}

@media (max-width: 768px) {
  .lamp-smart-fill__header {
    display: grid;
  }

  .lamp-smart-fill__badge {
    width: max-content;
  }

  .lamp-smart-fill__actions {
    display: grid;
  }

  .lamp-smart-fill__actions button {
    width: 100%;
    min-height: 44px;
  }

  .lamp-smart-fill__grid {
    grid-template-columns: 1fr;
  }
}
.sc-help {
  display: inline-block;
  position: relative;
  margin-left: 6px;
  vertical-align: middle;
}

.sc-help > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.sc-help > summary::-webkit-details-marker {
  display: none;
}

.sc-help__body {
  position: absolute;
  z-index: 30;
  top: 28px;
  left: 0;
  width: min(320px, 80vw);
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  color: #1f2937;
  line-height: 1.55;
}

.sc-help__body p {
  margin: 6px 0 0;
}

.sc-help__risk {
  color: #b45309;
  font-weight: 700;
}

.external-config-panel .checkbox-row {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .sc-help {
    display: block;
    margin: 6px 0 0;
  }

  .sc-help__body {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }
}

.photo-match-controls {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.photo-match-controls label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #475569;
}

.photo-match-controls select,
.photo-match-controls input[type="text"],
.photo-match-controls input[inputmode="numeric"],
.photo-match-controls input:not([type]) {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d8dee9;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.photo-match-controls .inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 8px;
  min-height: 32px;
}

.photo-match-controls .inline-check input {
  width: auto;
  margin-top: 3px;
}

.photo-match-controls small {
  line-height: 1.45;
}

.photo-upload-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.photo-upload-choice .field {
  margin: 0;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
}

.label-print-form {
  display: grid;
  gap: 18px;
}

.label-print-form fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}

.label-print-form legend {
  padding: 0 8px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.label-print-form .form-grid.four {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.label-print-form .field.wide {
  grid-column: span 2;
}

.label-print-form select,
.label-print-form input {
  min-height: 42px;
}

.label-print-form .notice-panel {
  margin: 0;
}

.label-print-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.label-print-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.lamp-bulk-mode-hint {
  margin: 12px 0 16px;
}

.lamp-task-table .label-print-check,
.lamp-mf-card .label-print-check {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
}

@media (max-width: 768px) {
  .photo-upload-choice {
    grid-template-columns: 1fr;
  }

  .label-print-form fieldset {
    padding: 14px;
  }

  .label-print-form .form-grid.four {
    grid-template-columns: 1fr;
  }

  .label-print-form .field.wide {
    grid-column: auto;
  }

  .lamp-mf-card .label-print-check {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .lamp-mf-card .label-print-check input {
    width: 20px;
    height: 20px;
  }
}
/* Incense-lamp photo review manual binding */
.il-pr-manual-bind {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #dbe3ef;
}

.il-pr-bind-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.il-pr-bind-search label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-weight: 700;
}

.il-pr-bind-search input,
.il-pr-bind-result input[type="text"],
.il-pr-bind-result input:not([type]) {
  min-height: 40px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  padding: 8px 10px;
}

.il-pr-bind-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.il-pr-bind-result {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
}

.il-pr-bind-result strong,
.il-pr-bind-result small {
  display: block;
}

.il-pr-bind-result small {
  margin-top: 4px;
  color: #64748b;
  line-height: 1.45;
}

.il-pr-bind-confirm {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #475569;
  font-weight: 700;
}

@media (max-width: 768px) {
  .il-pr-bind-search,
  .il-pr-bind-result {
    grid-template-columns: 1fr;
  }
}

/* Photo upload auto-match review workbench */
.photo-upload-review {
  display: grid;
  gap: 20px;
}

.photo-upload-review__list {
  display: grid;
  gap: 18px;
}

.photo-upload-review__card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.photo-upload-review__card.is-warning {
  border-color: #f59e0b;
  box-shadow: 0 18px 45px rgba(245, 158, 11, 0.12);
}

.photo-upload-review__card.is-caution {
  border-color: #facc15;
}

.photo-upload-review__card.is-confidence-high {
  border-color: #22c55e;
  box-shadow: 0 18px 45px rgba(34, 197, 94, 0.12);
}

.photo-upload-review__card.is-confidence-medium {
  border-color: #f59e0b;
  box-shadow: 0 18px 45px rgba(245, 158, 11, 0.1);
}

.photo-upload-review__card.is-confidence-low {
  border-color: #ef4444;
  box-shadow: 0 18px 45px rgba(239, 68, 68, 0.12);
}

.photo-upload-review__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid #e5e7eb;
}

.photo-upload-review__card-head strong {
  display: block;
  font-size: 18px;
  color: #0f172a;
}

.photo-upload-review__card-head p {
  margin: 4px 0 0;
  color: #64748b;
}

.photo-upload-review__compare {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 20px;
  padding: 20px;
}

.photo-upload-review__left,
.photo-upload-review__right {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.photo-upload-review__order,
.photo-upload-review__manual,
.photo-upload-review__candidates,
.photo-upload-review__image,
.photo-upload-review__ocr,
.photo-upload-review__controls {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}

.photo-upload-review__eyebrow {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.photo-upload-review__order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.photo-upload-review__order-head strong {
  font-size: 24px;
  color: #111827;
}

.photo-upload-review__facts,
.photo-upload-review__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.photo-upload-review__facts div,
.photo-upload-review__meta div {
  min-width: 0;
}

.photo-upload-review__facts .is-wide,
.photo-upload-review__meta .is-wide {
  grid-column: 1 / -1;
}

.photo-upload-review__facts dt,
.photo-upload-review__meta dt {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 13px;
}

.photo-upload-review__facts dd,
.photo-upload-review__meta dd {
  margin: 0;
  color: #0f172a;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.photo-upload-review__empty {
  border-radius: 12px;
  background: #fff7ed;
  padding: 14px;
  color: #9a3412;
}

.photo-upload-review__empty p {
  margin: 6px 0 0;
}

.photo-upload-review__candidate-list,
.photo-upload-review__search-results {
  display: grid;
  gap: 10px;
}

.photo-upload-review__candidate {
  justify-content: flex-start;
  height: auto;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  white-space: normal;
}

.photo-upload-review__candidate.is-recommended {
  border-color: #93c5fd;
  background: #eff6ff;
}

.photo-upload-review__candidate span,
.photo-upload-review__candidate small {
  display: block;
}

.photo-upload-review__candidate small {
  margin-top: 2px;
  color: #64748b;
}

.photo-upload-review__more-candidates {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
}

.photo-upload-review__more-candidates > summary {
  cursor: pointer;
  min-height: 40px;
  color: #2563eb;
  font-weight: 700;
}

.photo-upload-review__more-candidates > .photo-upload-review__candidate-list {
  margin-top: 10px;
}

.photo-upload-review__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.photo-upload-review__search input {
  min-height: 44px;
}

.photo-upload-review__image {
  margin: 0;
}

.photo-upload-review__image a {
  display: block;
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.photo-upload-review__image img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.photo-upload-review__image figcaption {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
}

.photo-upload-review__ocr summary {
  cursor: pointer;
  font-weight: 700;
}

.photo-upload-review__ocr pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
}

.photo-upload-review__controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 20px 20px;
  background: #f8fafc;
}

.photo-upload-review__controls label {
  min-width: 0;
}

.photo-upload-review__controls .inline-check,
.photo-upload-review__controls .warning-text,
.photo-upload-review__controls .toolbar-note {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .photo-upload-review__compare {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .photo-upload-review__card-head,
  .photo-upload-review__order-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .photo-upload-review__compare,
  .photo-upload-review__controls {
    padding: 14px;
    margin: 0;
  }

  .photo-upload-review__facts,
  .photo-upload-review__meta,
  .photo-upload-review__controls,
  .photo-upload-review__search {
    grid-template-columns: 1fr;
  }

  .photo-upload-review__image img {
    max-height: 420px;
  }
}

/* 当前页照片放大查看器：用于照片审核、上传预检、售灯/售香详情 */
.photo-lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  padding: 20px;
}

.photo-lightbox.is-open {
  display: grid;
  place-items: center;
}

.photo-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
}

.photo-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(1080px, 96vw);
  height: min(820px, 92dvh);
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 16px;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.42);
  overflow: hidden;
}

.photo-lightbox__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.96);
}

.photo-lightbox__title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.photo-lightbox__hint {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.photo-lightbox__hint::after {
  content: " 默认已适应屏幕。";
}

.photo-lightbox__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.photo-lightbox__actions button,
.photo-lightbox__original {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.photo-lightbox__actions button:hover,
.photo-lightbox__original:hover,
.photo-lightbox__actions button:focus-visible,
.photo-lightbox__original:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.photo-lightbox__stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
  padding: 16px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.photo-lightbox__image {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
}

.photo-lightbox__image[hidden] {
  display: none;
}

.photo-lightbox__image.is-dragging {
  cursor: grabbing;
  transition: none;
}

.photo-lightbox__loading,
.photo-lightbox__error {
  padding: 16px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
}

.photo-lightbox__loading {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #dbeafe;
}

.photo-lightbox__error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

[data-photo-lightbox],
[data-il-photo-open] {
  cursor: zoom-in;
}

@media (max-width: 768px) {
  .photo-lightbox {
    padding: 0;
  }

  .photo-lightbox__panel {
    width: 100dvw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .photo-lightbox__toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .photo-lightbox__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .photo-lightbox__actions button,
  .photo-lightbox__original {
    min-height: 44px;
    padding: 0 8px;
    font-size: 12px;
    justify-content: center;
    display: inline-flex;
    align-items: center;
  }

  .photo-lightbox__hint {
    font-size: 11px;
  }

  .photo-lightbox__stage {
    padding: 10px;
  }
}

.mini-pagination button.page-link {
  border: 1px solid #d9e2ef;
  background: #fff;
  cursor: pointer;
}

.mini-pagination button.page-link.current {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  cursor: default;
}

/* 售灯页顶部批量工具：默认收起，避免把订单页撑成表格工具页 */
.lamp-compact-tool-panel {
  overflow: hidden;
  padding: 0;
}

.lamp-compact-tools {
  display: block;
}

.lamp-compact-tools__summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  list-style: none;
  min-height: 58px;
  padding: 14px 18px;
}

.lamp-compact-tools__summary::-webkit-details-marker {
  display: none;
}

.lamp-compact-tools__summary::after {
  background: #f8fafc;
  border: 1px solid #d9e2ef;
  border-radius: 999px;
  color: #37516d;
  content: "展开";
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
  padding: 5px 12px;
}

.lamp-compact-tools[open] .lamp-compact-tools__summary::after {
  content: "收起";
}

.lamp-compact-tools__title {
  color: #111827;
  font-weight: 800;
}

.lamp-compact-tools__summary small {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.lamp-compact-tools__body {
  border-top: 1px solid #e5edf6;
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.lamp-compact-tools__body .filter-grid,
.lamp-compact-tools__body .il-tool {
  margin: 0;
}

@media (max-width: 768px) {
  .lamp-compact-tools__summary {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .lamp-compact-tools__summary::after {
    margin-left: 0;
  }

  .lamp-compact-tools__body {
    padding: 14px 12px 16px;
  }
}
/* 香灯来源渠道选择器：替代 datalist，保证手机端可点选、不可输入未知渠道 */
.source-channel-picker-field {
  position: relative;
}

.source-channel-picker {
  position: relative;
  width: 100%;
}

.source-channel-picker__button {
  align-items: center;
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  font: inherit;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.source-channel-picker__button:focus,
.source-channel-picker__search:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
  outline: none;
}

.source-channel-picker__panel {
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  left: 0;
  margin-top: 8px;
  max-height: min(360px, 56vh);
  overflow: auto;
  padding: 10px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 50;
}

.source-channel-picker__search {
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.source-channel-picker__options {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.source-channel-picker__option {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  gap: 3px;
  justify-content: center;
  min-height: 44px;
  padding: 9px 10px;
  text-align: left;
}

.source-channel-picker__option:hover,
.source-channel-picker__option:focus {
  background: #eff6ff;
  border-color: #bfdbfe;
  outline: none;
}

.source-channel-picker__option small {
  color: #64748b;
  font-size: 12px;
}

.source-channel-picker__empty {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #9a3412;
  font-size: 13px;
  margin-top: 8px;
  padding: 10px 12px;
}

.source-channel-picker__legacy {
  color: #9a3412;
}

@media (max-width: 768px) {
  .source-channel-picker__panel {
    max-height: 46vh;
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 16px;
  }
}

.is-disabled-like,
.is-disabled-like:hover {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

tr.is-muted {
  color: #6b7280;
  background: #f9fafb;
}

.lamp-danger-details {
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px;
  background: #fff7f7;
}

.lamp-danger-details > summary {
  cursor: pointer;
  font-weight: 700;
  color: #991b1b;
}
.lamp-wb2-card__split {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.lamp-wb2-card__split span,
.lamp-wb2-card__split a {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(71, 105, 246, 0.08);
}

.lamp-wb2-card__split a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.lamp-wb2-card__split a:hover,
.lamp-wb2-card__split a:focus-visible {
  background: rgba(71, 105, 246, 0.14);
  text-decoration: underline;
}

.il-channel-section + .il-channel-section,
.il-channels-panel + .il-channels-panel {
  margin-top: 28px;
}

.il-channel-section .il-channel-create-form,
.il-channels-panel .il-channel-create-form {
  margin-top: 16px;
}

.photo-upload-progress {
  border: 1px solid #cfe0ff;
  border-radius: 10px;
  background: #f6f9ff;
  padding: 12px;
}

.photo-upload-progress__bar {
  height: 10px;
  border-radius: 999px;
  background: #e7eefc;
  overflow: hidden;
}

.photo-upload-progress__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.2s ease;
}

.photo-upload-progress p {
  margin: 8px 0 0;
  color: #334155;
  font-size: 0.92rem;
}

.photo-upload-batch-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.photo-upload-batch-result {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
}

.photo-upload-batch-result strong {
  color: #172554;
}

.photo-upload-batch-result span {
  color: #334155;
  font-size: 0.92rem;
}

.photo-upload-batch-result.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
/* Unified incense/lamp task execution page */
.lamp-batch-service-switch {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin: 12px 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.segmented-control__item {
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.segmented-control__item.is-active {
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.lamp-batch-inline-upload {
  margin-top: 14px;
}

.lamp-workflow-details {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 0.75rem 1rem;
}

.lamp-workflow-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #2563eb;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.lamp-workflow-details[open] summary {
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .lamp-batch-service-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .segmented-control__item {
    text-align: center;
  }
}
