@import url("./dashboard.css");
@import url("./data_center.css");
:root,
[data-theme="light"] {
  /* —— 企业级设计令牌（浅色：保留已确认视觉） —— */
  color-scheme: light;
  --ui-canvas: #f5f6f8;
  --ui-surface: #ffffff;
  --ui-surface-subtle: #f8fafc;
  --ui-surface-hover: #f4f7fb;
  --ui-text-primary: #1d2433;
  --ui-text-secondary: #667085;
  --ui-text-muted: #98a2b3;
  --ui-border: #e2e6ec;
  --ui-border-soft: #ebeff4;
  --ui-primary: #245fd8;
  --ui-primary-hover: #1f54c4;
  --ui-primary-soft: #ebf2ff;
  --ui-teal: #218a7a;
  --ui-teal-soft: #eaf6f3;
  --ui-gold: #b9853b;
  --ui-gold-soft: #faf3e8;
  --ui-success: #17a66a;
  --ui-danger: #d92d20;
  --ui-radius-control: 7px;
  --ui-radius-card: 12px;
  --ui-duration: 160ms;
  --ui-focus: rgba(36, 95, 216, 0.18);
  --ui-shadow-card:
    0 1px 2px rgba(15, 23, 42, 0.025),
    0 8px 24px rgba(15, 23, 42, 0.03);
  --ui-control-bg: #ffffff;
  --ui-control-border: #dde3ea;
  --ui-control-border-hover: #b9c5d4;
  --ui-topbar-bg: #ffffff;
  --ui-mask: rgba(17, 24, 39, 0.42);
  --ui-modal-surface: #ffffff;
  --ui-dropdown-surface: #ffffff;
  --ui-scroll-thumb: #d0d7e2;
  --ui-scroll-thumb-hover: #b8c2d0;
  --ui-table-head: #f7f9fc;
  --ui-table-row: #ffffff;
  --ui-table-hover: #f8fbff;
  --ui-table-selected: #ebf2ff;
  --ui-hero-from: #fbfcfe;
  --ui-hero-to: #f5f8fc;
  --ui-hero-glow: rgba(75, 125, 230, 0.14);
  --chart-band: #f8fafc;
  --chart-grid: #eef2f7;
  --chart-grid-strong: #e2e8f0;
  --chart-axis: #94a3b8;
  --chart-tooltip: #202a37;
  --chart-series-1: #245fd8;
  --chart-series-2: #218a7a;
  --chart-series-3: #b9853b;
  --chart-series-4: #d92d20;
  --chart-series-5: #5b6b8c;
  --theme-seg-bg: #f2f4f7;
  --theme-seg-active-bg: #ffffff;
  --theme-seg-active-text: #1d2433;
  --theme-seg-idle-text: #7a8699;
  --theme-seg-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);

  /* 兼容旧变量名 → 映射到新令牌（业务 JS 仍可读旧名） */
  --brand: var(--ui-primary);
  --brand-dark: var(--ui-primary-hover);
  --page-bg: var(--ui-canvas);
  --card: var(--ui-surface);
  --border: var(--ui-border);
  --border-soft: var(--ui-border-soft);
  --text: var(--ui-text-primary);
  --text-soft: var(--ui-text-secondary);
  --muted: var(--ui-text-muted);
  --green: var(--ui-success);
  --orange: var(--ui-gold);
  --red: var(--ui-danger);
  --cyan: var(--ui-teal);
  --purple: #5b6b8c;
  --gray: #6b7785;
  --dark: #1d2433;
  --radius: var(--ui-radius-card);
  --shadow: var(--ui-shadow-card);
}

[data-theme="dark"] {
  color-scheme: dark;
  --ui-canvas: #0e131b;
  --ui-surface: #151b25;
  --ui-surface-subtle: #1b2430;
  --ui-surface-hover: #222c3a;
  --ui-text-primary: #f2f4f7;
  --ui-text-secondary: #b8c0cc;
  --ui-text-muted: #7f8a9a;
  --ui-border: #2a3442;
  --ui-border-soft: #222b37;
  --ui-primary: #6ea0ff;
  --ui-primary-hover: #8ab3ff;
  --ui-primary-soft: rgba(78, 134, 235, 0.16);
  --ui-teal: #52b6aa;
  --ui-teal-soft: rgba(82, 182, 170, 0.13);
  --ui-gold: #d6a85b;
  --ui-gold-soft: rgba(214, 168, 91, 0.13);
  --ui-success: #43c58a;
  --ui-danger: #f97066;
  --ui-focus: rgba(110, 160, 255, 0.16);
  --ui-shadow-card:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 12px 32px rgba(0, 0, 0, 0.16);
  --ui-control-bg: #111823;
  --ui-control-border: #344052;
  --ui-control-border-hover: #526174;
  --ui-topbar-bg: #131a24;
  --ui-mask: rgba(3, 7, 13, 0.62);
  --ui-modal-surface: #171e29;
  --ui-dropdown-surface: #1b2430;
  --ui-scroll-thumb: #3a4658;
  --ui-scroll-thumb-hover: #526174;
  --ui-table-head: #1b2430;
  --ui-table-row: #151b25;
  --ui-table-hover: #1d2734;
  --ui-table-selected: rgba(78, 134, 235, 0.14);
  --ui-hero-from: #171e2a;
  --ui-hero-to: #131923;
  --ui-hero-glow: rgba(75, 125, 230, 0.22);
  --chart-band: #1b2430;
  --chart-grid: #27313e;
  --chart-grid-strong: #2a3442;
  --chart-axis: #8e9aaa;
  --chart-tooltip: #202a37;
  --chart-series-1: #6ea0ff;
  --chart-series-2: #52b6aa;
  --chart-series-3: #d6a85b;
  --chart-series-4: #f97066;
  --chart-series-5: #8e9aaa;
  --theme-seg-bg: #1b2430;
  --theme-seg-active-bg: #2a3545;
  --theme-seg-active-text: #f2f4f7;
  --theme-seg-idle-text: #8e9aaa;
  --theme-seg-shadow: none;
  --purple: #8e9aaa;
  --gray: #8e9aaa;
  --dark: #f2f4f7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }

/* ---------------------------------------------------------- 登录页
   企业级左右分栏；样式仅限定在 .login-page 下，不破 .hidden 隐藏逻辑 */

.login-page {
  --login-blue-deep: #132d72;
  --login-blue: #194bb8;
  --login-cyan: #278fd3;
  --login-right-bg: #f6f8fb;
  --login-text: #1d2433;
  --login-muted: #7a8699;
  --login-border: #d7dee8;
  --login-primary: #214e91;
  --login-primary-hover: #1a3f78;
  --login-focus: rgba(36, 95, 216, 0.16);
  --login-pad-x: clamp(32px, 5vw, 88px);

  /* 不用 !important：.hidden { display:none !important } 仍可隐藏登录页 */
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--login-right-bg);
  color: var(--login-text);
}

.login-page .login-brand-panel {
  position: relative;
  flex: 0 0 54%;
  width: 54%;
  max-width: 54%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 52px var(--login-pad-x) 40px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(
      90% 120% at 88% 22%,
      rgba(103, 145, 255, 0.22) 0%,
      rgba(103, 145, 255, 0) 62%
    ),
    linear-gradient(
      145deg,
      var(--login-blue-deep) 0%,
      var(--login-blue) 54%,
      var(--login-cyan) 100%
    );
}

.login-page .login-brand-panel::before,
.login-page .login-brand-panel::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  z-index: 0;
}

.login-page .login-brand-panel::before {
  width: 140%;
  height: 70%;
  left: -48%;
  bottom: -28%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 40px rgba(255, 255, 255, 0.02);
}

.login-page .login-brand-panel::after {
  width: 90%;
  height: 55%;
  right: -35%;
  top: -18%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
}

.login-page .login-brand-panel__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.login-page .login-brand-header,
.login-page .login-brand-content,
.login-page .login-brand-footer {
  position: relative;
  z-index: 1;
}

.login-page .login-brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(28px, 5vh, 56px);
}

.login-page .login-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 4px;
}

.login-page .login-brand-header__text { min-width: 0; }
.login-page .login-brand-name {
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Hiragino Sans GB",
    "Noto Sans SC",
    "Segoe UI",
    sans-serif;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.2px;
  line-height: 1.25;
  color: #ffffff;
}
.login-page .login-brand-sub {
  margin-top: 4px;
  font-family:
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.login-page .login-brand-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 24px;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Hiragino Sans GB",
    "Noto Sans SC",
    "Segoe UI",
    sans-serif;
}

.login-page .login-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 20px;
}

.login-page .login-brand-title {
  margin: 0 0 22px;
  max-width: 12em;
  font-size: clamp(40px, 4.1vw, 64px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.login-page .login-brand-description {
  margin: 0 0 28px;
  max-width: 34em;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
}

.login-page .login-capabilities {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.login-page .login-capability {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.login-page .login-capability__mark {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
}
.login-page .login-capability__mark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 3px;
  width: 4px;
  height: 8px;
  border: solid rgba(255, 255, 255, 0.92);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.login-page .login-capability__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 3px;
}
.login-page .login-capability__desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

.login-page .login-brand-footer {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.login-page .login-auth-panel {
  flex: 1 1 46%;
  width: 46%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 24px 48px;
  background: var(--login-right-bg);
  color: var(--login-text);
}

.login-page .login-auth-content {
  width: min(420px, calc(100% - 48px));
  margin-top: -4vh;
}

.login-page .login-auth-heading {
  margin-bottom: 28px;
}
.login-page .login-auth-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--login-text);
  line-height: 1.2;
}
.login-page .login-auth-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--login-muted);
}

.login-page .login-form label {
  display: block;
  margin-bottom: 16px;
}
.login-page .login-form label > span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #526174;
  margin-bottom: 7px;
}
.login-page .login-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--login-border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--login-text);
  transition:
    border-color var(--ui-duration) ease,
    box-shadow var(--ui-duration) ease;
}
.login-page .login-form input::placeholder {
  color: #98a2b3;
}
.login-page .login-form input:focus {
  border-color: #245fd8;
  background: #fff;
  box-shadow: 0 0 0 3px var(--login-focus);
}
.login-page .login-form .btn-primary.btn-block {
  height: 44px;
  margin-top: 2px;
  border: 1px solid var(--login-primary);
  border-radius: 8px;
  background: var(--login-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  box-shadow: none;
}
.login-page .login-form .btn-primary.btn-block:hover:not(:disabled) {
  background: var(--login-primary-hover);
  border-color: var(--login-primary-hover);
  color: #fff;
}
.login-page .login-form .btn-primary.btn-block:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.login-page .login-form .btn-primary.btn-block:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--login-focus);
}

.login-page .login-error {
  color: var(--ui-danger);
  font-size: 12px;
  min-height: 18px;
  margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .login-page,
  .login-page * {
    animation: none !important;
    transition: none !important;
  }
}

/* 桌面中档：略收左侧 */
@media (max-width: 1439px) and (min-width: 1024px) {
  .login-page .login-brand-panel {
    flex-basis: 46%;
    width: 46%;
    max-width: 46%;
    padding-top: 44px;
    padding-bottom: 32px;
  }
  .login-page .login-auth-panel { width: 54%; flex-basis: 54%; }
  .login-page .login-brand-title { font-size: clamp(36px, 3.6vw, 56px); }
  .login-page .login-brand-description { font-size: 14px; }
}

/* 平板：精简品牌区，可藏能力卡 */
@media (max-width: 1023px) and (min-width: 768px) {
  .login-page .login-brand-panel {
    flex-basis: 40%;
    width: 40%;
    max-width: 40%;
    padding: 36px 28px 28px;
  }
  .login-page .login-auth-panel {
    width: 60%;
    flex-basis: 60%;
    padding: 32px 20px;
  }
  .login-page .login-brand-title { font-size: clamp(30px, 4.2vw, 44px); max-width: none; }
  .login-page .login-capabilities { display: none; }
  .login-page .login-brand-description { font-size: 13px; margin-bottom: 0; }
}

/* 窄屏：上下单栏；登录优先 */
@media (max-width: 767px) {
  .login-page {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .login-page .login-brand-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 16px 20px 16px;
  }
  .login-page .login-brand-header { margin-bottom: 12px; }
  .login-page .login-brand-content { justify-content: flex-start; padding-bottom: 8px; }
  .login-page .login-brand-title { font-size: clamp(24px, 7vw, 32px); margin-bottom: 0; }
  .login-page .login-brand-description { display: none; }
  .login-page .login-capabilities,
  .login-page .login-brand-footer { display: none; }
  .login-page .login-eyebrow { margin-bottom: 10px; }
  .login-page .login-auth-panel {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    align-items: flex-start;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .login-page .login-auth-content {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }
}

/* 矮手机：再压品牌文案，保证账号框首屏可见 */
@media (max-width: 767px) and (max-height: 740px) {
  .login-page .login-eyebrow { display: none; }
  .login-page .login-brand-title { font-size: 22px; margin-bottom: 0; }
  .login-page .login-brand-content { padding-bottom: 0; }
  .login-page .login-auth-panel { padding-top: 16px; }
  .login-page .login-auth-heading { margin-bottom: 14px; }
  .login-page .login-auth-title { font-size: 22px; }
}
@media (max-width: 767px) and (max-height: 640px) {
  .login-page .login-brand-title { display: none; }
}

/* 矮视口（桌面分栏）：压缩纯展示；手机走上面的窄屏规则 */
@media (max-height: 760px) and (min-width: 768px) {
  .login-page .login-brand-panel { padding-top: 32px; padding-bottom: 24px; }
  .login-page .login-brand-header { margin-bottom: 20px; }
  .login-page .login-brand-title { font-size: clamp(28px, 3.4vw, 44px); }
  .login-page .login-brand-description { margin-bottom: 16px; font-size: 13px; line-height: 1.6; }
  .login-page .login-capabilities { display: none; }
  .login-page .login-auth-content { margin-top: 0; }
  .login-page .login-auth-heading { margin-bottom: 18px; }
  .login-page .login-auth-title { font-size: 24px; }
}

/* ---------------------------------------------------------- 框架 */

.app { display: flex; min-height: 100vh; }

/* 全局左侧导航：珍珠灰＋宝石蓝（令牌仅作用在侧栏根节点） */
.sidebar {
  --sidebar-bg: #F8FAFC;
  --sidebar-bg-brand: #F8FAFC;
  --sidebar-bg-footer: #F8FAFC;
  --sidebar-bg-hover: #F1F5F9;
  --sidebar-bg-pressed: #E8EEF5;
  --sidebar-bg-expanded: #F1F5F9;
  --sidebar-bg-active: #EBF2FF;
  --sidebar-accent: #245FD8;
  --sidebar-accent-hover: #1F54C4;
  --sidebar-text-primary: #1D2433;
  --sidebar-text-secondary: #526174;
  --sidebar-text-muted: #98A2B3;
  --sidebar-text-active: #174EA6;
  --sidebar-text-nav: #526174;
  --sidebar-text-footer: #526174;
  --sidebar-icon: #7A8798;
  --sidebar-icon-active: #245FD8;
  --sidebar-border: #E2E6EC;
  --sidebar-guide: #D5DCE6;
  --sidebar-focus: rgba(36, 95, 216, 0.28);
  --sidebar-danger: #D92D20;
  --sidebar-danger-bg: rgba(217, 45, 32, 0.08);
  --sidebar-radius: 7px;
  --sidebar-duration: 160ms;
  /* 兼容旧引用名 */
  --sidebar-bg-soft: var(--sidebar-bg-hover);
  --sidebar-text: var(--sidebar-text-secondary);
  --nav-icon-slot: 18px;
  --nav-caret-slot: 14px;
  --nav-badge-slot: 28px;

  width: 182px;
  flex: 0 0 182px;
  min-width: 182px;
  max-width: 182px;
  transition:
    width var(--sidebar-duration) ease,
    flex-basis var(--sidebar-duration) ease,
    min-width var(--sidebar-duration) ease,
    max-width var(--sidebar-duration) ease;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text-secondary);
  border-right: 1px solid var(--sidebar-border);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

.sidebar-brand {
  flex: 0 0 auto;
  min-width: 0;
  height: 70px;
  padding: 0 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg-brand);
}
.sidebar-close,
.menu-toggle,
.sidebar-backdrop { display: none; }
.sidebar-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 0;
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  padding: 0;
}
.sidebar-collapse:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-primary);
}
.sidebar-collapse:focus { outline: none; }
.sidebar-collapse:focus-visible {
  outline: 2px solid var(--sidebar-focus);
  outline-offset: 1px;
}
.sidebar-collapse-icon::before {
  content: "‹";
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}
.topbar-titles { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.sidebar .brand-logo {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: var(--sidebar-radius);
  object-fit: contain;
  background: transparent;
  display: block;
  box-shadow: none;
}
.sidebar .brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.sidebar .brand-name {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--sidebar-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar .brand-sub {
  margin: 0;
  padding: 0;
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  letter-spacing: 0.055em;
  color: var(--sidebar-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 8px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.sidebar-footer {
  flex: 0 0 auto;
  flex-shrink: 0;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg-footer);
  padding: 6px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sidebar-footer-nav { min-width: 0; }
.sidebar-footer .nav-group { margin-top: 2px; }
/* 「我的」分组标题：保留钩子节点，隐藏可见文字 */
.sidebar-footer .nav-group--mine {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar .nav-group {
  margin: 10px 0 4px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.06em;
  color: #71849A;
}
.sidebar-nav > .nav-group:first-child { margin-top: 2px; }

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  margin-bottom: 1px;
  border: 0;
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--sidebar-text-nav);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition:
    background-color var(--sidebar-duration) ease,
    color var(--sidebar-duration) ease;
}
.sidebar .nav-item .nav-icon {
  flex: 0 0 var(--nav-icon-slot);
  width: var(--nav-icon-slot);
  height: var(--nav-icon-slot);
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  color: var(--sidebar-icon);
}
.sidebar .nav-item .nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar .nav-badge {
  flex: 0 0 auto;
  margin-left: auto;
  box-sizing: border-box;
  height: 18px;
  min-width: 18px;
  max-width: var(--nav-badge-slot);
  padding: 0 6px;
  border-radius: 9px;
  background: var(--sidebar-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar .nav-caret {
  flex: 0 0 var(--nav-caret-slot);
  width: var(--nav-caret-slot);
  margin-left: auto;
  font-size: 12px;
  line-height: 1;
  color: var(--sidebar-icon);
  transition:
    transform var(--sidebar-duration) ease,
    color var(--sidebar-duration) ease;
  transform-origin: center;
}
.sidebar .nav-item .nav-badge + .nav-caret { margin-left: 4px; }

.sidebar .nav-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-nav);
}
.sidebar .nav-item:hover .nav-icon,
.sidebar .nav-item:hover .nav-caret { color: var(--sidebar-icon); }
.sidebar .nav-item:active { background: var(--sidebar-bg-pressed); }

/* 无子菜单的当前叶子：浅蓝底 + 左侧宝石蓝指示条 */
.sidebar .nav-item.active:not(:has(+ .nav-sub)) {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}
.sidebar .nav-item.active:not(:has(+ .nav-sub))::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--sidebar-accent);
  pointer-events: none;
}
.sidebar .nav-item.active:not(:has(+ .nav-sub)) .nav-icon {
  color: var(--sidebar-icon-active);
}

/* 展开父级：中性展开态，不得与当前叶子同时强高亮 */
.sidebar .nav-item:has(+ .nav-sub),
.sidebar .nav-item.active:has(+ .nav-sub) {
  background: var(--sidebar-bg-expanded);
  color: var(--sidebar-text-nav);
  font-weight: 500;
  box-shadow: none;
}
.sidebar .nav-item:has(+ .nav-sub)::before,
.sidebar .nav-item.active:has(+ .nav-sub)::before { display: none; }
.sidebar .nav-item:has(+ .nav-sub) .nav-icon,
.sidebar .nav-item.active:has(+ .nav-sub) .nav-icon {
  color: var(--sidebar-icon);
}
.sidebar .nav-item:has(+ .nav-sub):hover { background: var(--sidebar-bg-hover); }

.sidebar .nav-item:focus { outline: none; }
.sidebar .nav-item:focus-visible {
  outline: 2px solid var(--sidebar-focus);
  outline-offset: 1px;
  z-index: 1;
}

.sidebar .nav-sub {
  margin: 0 0 6px 8px;
  padding: 2px 0 2px 12px;
  border-left: 0;
}
.sidebar .nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 0 8px 0 10px;
  margin-bottom: 1px;
  border: 0;
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--sidebar-text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition:
    background-color var(--sidebar-duration) ease,
    color var(--sidebar-duration) ease;
}
.sidebar .nav-subitem .nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 部门色点仍由菜单数据带出，旗舰侧栏不画点和轨道，只靠缩进 */
.sidebar .nav-subitem .dot {
  display: none;
}
.sidebar .nav-subitem:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-secondary);
}
.sidebar .nav-subitem:active { background: var(--sidebar-bg-pressed); }
.sidebar .nav-subitem.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}
.sidebar .nav-subitem.active::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--sidebar-accent);
  pointer-events: none;
}
.sidebar .nav-subitem.active .dot {
  background: var(--sidebar-accent) !important;
}
.sidebar .nav-subitem:focus { outline: none; }
.sidebar .nav-subitem:focus-visible {
  outline: 2px solid var(--sidebar-focus);
  outline-offset: 1px;
  z-index: 1;
}

.sidebar .nav-caret.open {
  transform: rotate(90deg);
  color: var(--sidebar-text-secondary);
}

/* 底部「更新记录 / 个人中心 / 退出登录」：13px / 500 / #465F78 */
.sidebar-footer .nav-item,
.sidebar-footer .nav-item:hover,
.sidebar-footer .nav-item:has(+ .nav-sub),
.sidebar-footer .nav-item.active:has(+ .nav-sub) {
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--sidebar-text-footer);
}
.sidebar-footer .nav-item.active:not(:has(+ .nav-sub)) {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text-active);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin: 2px 0 0;
  padding: 0 10px;
  border: 0;
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--sidebar-text-footer);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  text-align: left;
  transition:
    background-color var(--sidebar-duration) ease,
    color var(--sidebar-duration) ease;
}
.sidebar-logout .nav-icon {
  flex: 0 0 var(--nav-icon-slot);
  width: var(--nav-icon-slot);
  color: var(--sidebar-icon);
  font-size: 14px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.sidebar-logout .nav-label {
  flex: 1 1 auto;
  min-width: 0;
}
.sidebar-logout:hover {
  background: var(--sidebar-danger-bg);
  color: var(--sidebar-danger);
}
.sidebar-logout:hover .nav-icon { color: var(--sidebar-danger); }
.sidebar-logout:active { background: rgba(217, 45, 32, 0.12); }
.sidebar-logout:focus { outline: none; }
.sidebar-logout:focus-visible {
  outline: 2px solid var(--sidebar-focus);
  outline-offset: 1px;
}

/* 侧栏底部版本号（退出登录下方） */
.sidebar-version {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #98A2B3;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
}
.sidebar-version:hover { color: var(--sidebar-text-active); }
.sidebar-version:focus { outline: none; }
.sidebar-version:focus-visible {
  outline: 2px solid var(--sidebar-focus);
  outline-offset: 1px;
  border-radius: 4px;
}
/* 保留 topbar-version id 的隐藏别名，供同步与兼容点击 */
.sidebar-version--alias {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar .nav-item,
  .sidebar .nav-subitem,
  .sidebar .nav-caret,
  .sidebar-logout {
    transition: none !important;
  }
}

/* 桌面收起：只留图标栏。手机抽屉仍走原来的汉堡层，不套这套。 */
@media (min-width: 901px) {
  body.sidebar-collapsed .sidebar {
    width: 56px;
    flex-basis: 56px;
    min-width: 56px;
    max-width: 56px;
  }
  body.sidebar-collapsed .sidebar-brand {
    flex-direction: column;
    justify-content: center;
    height: auto;
    min-height: 70px;
    padding: 10px 0 8px;
    gap: 6px;
  }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-caret,
  body.sidebar-collapsed .nav-group,
  body.sidebar-collapsed .nav-sub {
    display: none;
  }
  body.sidebar-collapsed .sidebar-collapse {
    margin-left: 0;
  }
  body.sidebar-collapsed .sidebar-collapse-icon::before {
    content: "›";
  }
  body.sidebar-collapsed .sidebar-nav {
    padding: 6px 6px 8px;
  }
  body.sidebar-collapsed .sidebar .nav-item,
  body.sidebar-collapsed .sidebar-logout {
    justify-content: center;
    padding: 0;
    gap: 0;
  }
  body.sidebar-collapsed .sidebar .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    max-width: 22px;
    height: 16px;
    padding: 0 4px;
    line-height: 16px;
    font-size: 9px;
  }
  body.sidebar-collapsed .sidebar-footer {
    padding: 6px 4px 10px;
  }
  body.sidebar-collapsed .sidebar-version {
    padding: 0 2px;
    text-align: center;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

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

.topbar {
  height: 50px; background: var(--ui-topbar-bg); border-bottom: 1px solid var(--ui-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; position: sticky; top: 0; z-index: 20;
  box-shadow: none;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar h2 {
  margin: 0; font-size: 16px; font-weight: 650;
  color: var(--ui-text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-sub {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw;
}
.topbar-right {
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto; min-width: 0;
}

/* 公告：顶栏中间槽 + 登录弹窗。不改主题/时钟/刷新/人名。 */
.topbar-center {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}
.topbar-center[hidden] { display: none !important; }
.notice-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  background: var(--ui-surface);
}
.notice-ticker__tag {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ui-text-muted);
  letter-spacing: 0.04em;
}
.notice-ticker__title {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ui-text-primary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
}
.notice-ticker__title:hover { color: var(--ui-primary); }
.notice-ticker__more {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--ui-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.notice-popup-mask {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(15, 20, 30, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.notice-popup {
  width: min(480px, 100%);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 22px 22px 18px;
  box-shadow: 0 16px 40px rgba(15, 20, 30, 0.18);
}
.notice-popup__eyebrow {
  font-size: 11px;
  color: var(--ui-text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.notice-popup__title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 650;
  color: var(--ui-text-primary);
}
.notice-popup__body {
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--ui-text-secondary);
  max-height: 40vh;
  overflow: auto;
  min-height: 80px;
}
.notice-popup__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.notice-popup__ack { min-width: 96px; height: 36px; }

/* 顶栏主题双段切换器：主题｜时间｜刷新｜用户 */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: 136px;
  height: 32px;
  padding: 2px;
  border-radius: 7px;
  background: var(--theme-seg-bg);
  border: 1px solid var(--ui-border-soft);
  flex: 0 0 auto;
  box-sizing: border-box;
}
.theme-switcher__btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
  min-width: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--theme-seg-idle-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--ui-duration) ease,
    color var(--ui-duration) ease,
    box-shadow var(--ui-duration) ease;
}
.theme-switcher__btn.is-active {
  background: var(--theme-seg-active-bg);
  color: var(--theme-seg-active-text);
  box-shadow: var(--theme-seg-shadow);
}
.theme-switcher__btn:focus { outline: none; }
.theme-switcher__btn:focus-visible {
  box-shadow: 0 0 0 3px var(--ui-focus);
}
.theme-switcher__icon {
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}
.theme-switcher__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.topbar-clock__icon {
  font-size: 13px;
  color: var(--ui-text-muted);
  line-height: 1;
}
.topbar-clock__text { letter-spacing: 0.01em; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--ui-control-border);
  background: var(--ui-control-bg); color: var(--text-soft); cursor: pointer; font-size: 15px; line-height: 1;
  transition: border-color var(--ui-duration) ease, color var(--ui-duration) ease;
}
.icon-btn:hover { border-color: var(--ui-control-border-hover); color: var(--ui-primary); }
.icon-btn:focus { outline: none; }
.icon-btn:focus-visible { box-shadow: 0 0 0 3px var(--ui-focus); }

/* 顶栏账号：对齐时钟控件，禁止整颗深蓝胶囊 */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  max-width: min(280px, 42vw);
  padding: 0 10px 0 4px;
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  background: var(--ui-surface);
  color: var(--ui-text-primary);
  box-shadow: none;
  overflow: hidden;
}
.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  flex: 0 0 auto;
}
.user-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ui-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  font-size: 10px;
  font-weight: 500;
  color: var(--ui-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content { flex: 1; padding: 14px 16px 6px; }
.footer { text-align: center; color: var(--muted); font-size: 11px; padding: 12px 0 16px; }

/* 兼容旧版 version-chip 类名（若模块内仍引用） */
.version-chip {
  border: 1px solid var(--ui-border); background: var(--ui-surface-subtle); color: var(--ui-text-muted);
  font-family: inherit; font-size: 11px; font-weight: 500;
  height: 28px; padding: 0 10px; border-radius: 7px; cursor: pointer;
}
.version-chip:hover { background: var(--ui-primary-soft); border-color: #C5D4F0; color: var(--ui-primary); }

/* 更新版本记录 / 版本回溯 */
.changelog-toolbar { flex-wrap: wrap; gap: 8px; }
.changelog-select {
  height: 30px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px;
  background: #fff; color: var(--text); font-size: 12px; min-width: 150px;
}
.changelog-pills {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px;
}
.changelog-pill {
  border: 1px solid var(--border); background: #fff; color: var(--text-soft);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  height: 28px; padding: 0 10px; border-radius: 999px; cursor: pointer;
}
.changelog-pill:hover { border-color: var(--brand); color: var(--brand); }
.changelog-pill.active { border-color: var(--brand); background: #eef4ff; color: var(--brand); font-weight: 700; }
.changelog-pill.current { box-shadow: inset 0 0 0 1px rgba(18, 163, 112, 0.35); }

.changelog-focus-card { margin-bottom: 0; }
.changelog-focus-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px;
}
@media (max-width: 900px) { .changelog-focus-meta { grid-template-columns: 1fr; } }
.changelog-focus-title { font-size: 14px; font-weight: 600; margin: 4px 0 2px; }
.changelog-path { margin-top: 10px; font-size: 11px; line-height: 1.7; }

.changelog-list { display: flex; flex-direction: column; gap: 0; }
.changelog-item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px;
  position: relative; padding-bottom: 22px; cursor: pointer;
}
.changelog-item:last-child { padding-bottom: 0; }
.changelog-rail { position: relative; }
.changelog-rail::before {
  content: ''; position: absolute; left: 7px; top: 18px; bottom: -22px; width: 1px; background: var(--border);
}
.changelog-item:last-child .changelog-rail::before { display: none; }
.changelog-dot {
  display: block; width: 15px; height: 15px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-sizing: border-box;
}
.changelog-item.current .changelog-dot {
  border-color: var(--green); background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 163, 112, 0.16);
}
.changelog-item.focus .changelog-dot {
  border-color: var(--brand); background: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 126, 240, 0.18);
}
.changelog-body {
  background: #fbfcfe; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
.changelog-item:hover .changelog-body { border-color: #c8daf7; }
.changelog-item.current .changelog-body {
  border-color: #b7e5cf; background: #f3fbf7;
}
.changelog-item.focus .changelog-body {
  border-color: var(--brand); box-shadow: 0 0 0 2px rgba(47, 126, 240, 0.12);
  background: #f7faff;
}
.changelog-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.changelog-module {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #1f4b99;
  background: #eef4ff;
  border: 1px solid #c8daf7;
}
.changelog-version {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700;
  color: var(--text);
}
.changelog-time { font-size: 11px; color: var(--muted); }
.changelog-title { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.changelog-highlights {
  margin: 8px 0 0; padding-left: 18px; color: var(--text-soft);
  font-size: 12px; line-height: 1.7;
}
.changelog-highlights li { margin-bottom: 2px; }

/* ---------------------------------------------------------- 通用卡片 */

.card {
  background: var(--ui-surface); border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-card); margin-bottom: 12px;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--ui-border-soft);
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 650; color: var(--ui-text-primary); }
.card-head .spacer { flex: 1; }
.card-body { padding: 12px 14px; }
.card-body.tight { padding: 0; }

.section-title {
  font-size: 14px; font-weight: 650; margin: 4px 0 10px; color: var(--ui-text-primary);
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 3px; height: 13px; background: var(--ui-primary); border-radius: 2px;
}

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-card);
  padding: 10px 12px; margin-bottom: 12px; box-shadow: var(--ui-shadow-card);
}
.toolbar .spacer { flex: 1; }
.toolbar-label { font-size: 12px; color: var(--text-soft); }

/* ---------------------------------------------------------- 表单控件（限定在应用壳与登录页，不污染第三方） */

.app input,
.app select,
.app textarea,
.login-page input,
.login-page select,
.login-page textarea,
.modal input,
.modal select,
.modal textarea,
.drawer input,
.drawer select,
.drawer textarea {
  font-family: inherit; font-size: 12px; color: var(--text);
  border: 1px solid var(--ui-control-border); border-radius: var(--ui-radius-control);
  background: var(--ui-control-bg);
  padding: 0 9px; height: 30px; outline: none;
  transition: border-color var(--ui-duration) ease, box-shadow var(--ui-duration) ease;
}
.app input::placeholder,
.app textarea::placeholder,
.modal input::placeholder,
.modal textarea::placeholder,
.drawer input::placeholder,
.drawer textarea::placeholder {
  color: var(--ui-text-muted);
}
.app textarea,
.login-page textarea,
.modal textarea,
.drawer textarea { height: auto; padding: 7px 9px; line-height: 1.6; resize: vertical; }
.app input:focus,
.app select:focus,
.app textarea:focus,
.login-page input:focus,
.login-page select:focus,
.login-page textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.drawer input:focus,
.drawer select:focus,
.drawer textarea:focus {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 3px var(--ui-focus);
}
.app input[type="date"],
.login-page input[type="date"] { padding-right: 4px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--text-soft); margin-bottom: 5px; }
label.field input, label.field select, label.field textarea { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

.btn {
  height: 30px; padding: 0 14px; border-radius: var(--ui-radius-control); border: 1px solid var(--ui-control-border);
  background: var(--ui-control-bg); color: var(--text); font-size: 12px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: border-color var(--ui-duration) ease, color var(--ui-duration) ease, background var(--ui-duration) ease;
  white-space: nowrap; flex-shrink: 0;
}
.btn:hover { border-color: var(--ui-control-border-hover); color: var(--ui-primary); }
.btn:focus { outline: none; }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--ui-focus); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
.btn-primary:hover { background: var(--ui-primary-hover); border-color: var(--ui-primary-hover); color: #fff; }
.btn-danger { background: var(--ui-danger); border-color: var(--ui-danger); color: #fff; }
.btn-danger:hover { background: #c4281c; border-color: #c4281c; color: #fff; }
.btn-success { background: var(--ui-success); border-color: var(--ui-success); color: #fff; }
.btn-success:hover { background: #128a58; border-color: #128a58; color: #fff; }
.btn-sm { height: 24px; padding: 0 9px; font-size: 11px; }
.btn-block { width: 100%; height: 38px; justify-content: center; font-size: 14px; }
.btn-link {
  border: 0; background: transparent; color: var(--ui-primary); padding: 0 6px; height: auto;
  font-size: 12px; font-weight: 500; box-shadow: none; min-height: 0;
  white-space: nowrap; flex-shrink: 0;
}
.btn-link:hover { color: var(--ui-primary-hover); background: transparent; border-color: transparent; }
.btn-link:disabled { opacity: 0.45; cursor: not-allowed; }
.table-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 168px;
}
.table-actions .btn,
.table-actions .btn-sm {
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 0;
  height: 24px;
}
table.data td:has(.table-actions) {
  width: 180px;
  min-width: 180px;
  white-space: nowrap;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ui-border); margin-bottom: 12px; }
.tab {
  border: 0; background: transparent; padding: 8px 14px; font-size: 13px;
  color: var(--ui-text-secondary); cursor: pointer; border-bottom: 2px solid transparent;
  transition: color var(--ui-duration) ease;
}
.tab:hover { color: var(--ui-primary); }
.tab.active { color: var(--ui-primary); border-bottom-color: var(--ui-primary); font-weight: 500; }
.tab .count { color: var(--muted); font-size: 11px; margin-left: 4px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--ui-border); background: var(--ui-surface); border-radius: var(--ui-radius-control);
  padding: 3px 11px; font-size: 11px; color: var(--text-soft); cursor: pointer;
}
.chip.active { border-color: var(--ui-primary); background: var(--ui-primary-soft); color: var(--ui-primary); }

/* ---------------------------------------------------------- KPI 卡片（低饱和表面，语义色小面积表达） */

.kpi-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px; margin-bottom: 14px;
}
@media (max-width: 1500px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kpi {
  border-radius: var(--ui-radius-card); padding: 12px 14px;
  color: var(--ui-text-primary);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 78px; box-shadow: var(--ui-shadow-card); position: relative; overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ui-primary);
}
.kpi-dark { background: var(--ui-surface-subtle); }
.kpi-dark::before { background: #475467; }
.kpi-green { background: #f3fbf7; }
.kpi-green::before { background: var(--ui-success); }
.kpi-orange { background: var(--ui-gold-soft); }
.kpi-orange::before { background: var(--ui-gold); }
.kpi-red { background: #fef3f2; }
.kpi-red::before { background: var(--ui-danger); }
.kpi-gray { background: var(--ui-surface-subtle); }
.kpi-gray::before { background: #98A2B3; }
.kpi-cyan { background: var(--ui-teal-soft); }
.kpi-cyan::before { background: var(--ui-teal); }
.kpi-purple { background: var(--ui-primary-soft); }
.kpi-purple::before { background: var(--ui-primary); }

.kpi-label { font-size: 12px; color: var(--ui-text-secondary); opacity: 1; }
.kpi-value {
  font-size: 24px; font-weight: 650; margin-top: 4px; letter-spacing: 0.2px;
  color: var(--ui-text-primary); font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 12px; font-weight: 500; margin-left: 2px; opacity: 0.85; }
.kpi-delta { font-size: 11px; color: var(--ui-text-muted); opacity: 1; margin-top: 3px; }
.kpi-chart { width: 88px; height: 42px; flex: 0 0 88px; opacity: 0.9; }

/* ---------------------------------------------------------- 表格 */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--ui-text-secondary); background: var(--ui-table-head);
  padding: 9px 12px; border-bottom: 1px solid var(--ui-border); white-space: nowrap;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--ui-border-soft); vertical-align: middle; color: var(--ui-text-primary); background: var(--ui-table-row); }
table.data tbody tr:hover td { background: var(--ui-table-hover); }
table.data tbody tr.selected td,
table.data tbody tr[aria-selected="true"] td { background: var(--ui-table-selected); }
table.data tr.clickable { cursor: pointer; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 34px 0; font-size: 12px; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; }
.pager span { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------- 徽标 */

.badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 4px;
  padding: 2px 7px; font-size: 11px; line-height: 17px; white-space: nowrap;
}
.badge-info { background: #e8f1ff; color: #1f6fd8; }
.badge-success { background: #e4f7ef; color: #0e8c60; }
.badge-warn { background: #fdf3e0; color: #b97b06; }
.badge-danger { background: #fdeceb; color: #c93c31; }
.badge-muted { background: #f0f2f6; color: #6b7785; }
.badge-done { background: #eef0f4; color: #55617a; }
.badge-p0 { background: #fdeceb; color: #c93c31; font-weight: 600; }
.badge-p1 { background: #fdf3e0; color: #b97b06; font-weight: 600; }
.badge-p2 { background: #e8f1ff; color: #1f6fd8; }
.badge-p3 { background: #f0f2f6; color: #6b7785; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.tag-square {
  width: 24px; height: 24px; border-radius: 5px; color: #fff; display: grid;
  place-items: center; font-size: 11px; flex: 0 0 24px;
}
.avatar {
  width: 24px; height: 24px; border-radius: 50%; color: #fff; display: grid;
  place-items: center; font-size: 11px; flex: 0 0 24px;
}
.avatar-lg { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; flex-basis: 40px; }
.inline { display: flex; align-items: center; gap: 7px; }
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, Consolas, monospace; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

/* ---------------------------------------------------------- 看板：部门详情 */

.dash-split { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .dash-split { grid-template-columns: 1fr; } }

.dept-focus-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.dept-focus-head .name { font-size: 14px; font-weight: 600; }
.dept-focus-head .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.metric-list { padding: 4px 0 8px; }
.metric-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px; font-size: 12px;
}
.metric-row:nth-child(odd) { background: #fafbfd; }
.metric-row .k { color: var(--text-soft); }
.metric-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.dept-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft); cursor: pointer; transition: 0.12s;
}
.dept-row:hover { background: #f8fbff; }
.dept-row.selected { background: #f2f7ff; box-shadow: inset 3px 0 0 var(--brand); }
.dept-row .dept-main { min-width: 148px; }
.dept-row .dept-name { font-size: 13px; font-weight: 600; }
.dept-row .dept-duty { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dept-row .dept-stats { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
.dept-stat { min-width: 62px; }
.dept-stat .k { font-size: 10px; color: var(--muted); }
.dept-stat .v { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dept-row .dept-actions { display: flex; gap: 6px; }

/* ---------------------------------------------------------- 图表 */

.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 1200px) { .chart-grid { grid-template-columns: 1fr; } }
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-item { font-size: 12px; }
.bar-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.bar-track { height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--brand); }

/* ---------------------------------------------------------- 工作台 */

.wb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
@media (max-width: 1200px) { .wb-grid { grid-template-columns: 1fr; } }
.learning-prompts-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .learning-prompts-layout { grid-template-columns: 1fr; }
}

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stat-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow);
}
.stat-box .k { font-size: 11px; color: var(--muted); }
.stat-box .v { font-size: 20px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* 审核 · 退货绑定：压缩头图 + 6 指标卡 3×2 / 单行 */
.audit-shell--compact .ps-hero { padding: 12px 18px 0; }
.audit-shell--compact .ps-hero__row { margin-bottom: 10px; gap: 12px; align-items: center; }
.audit-shell--compact .ps-hero__title { font-size: 26px; }
.audit-shell--compact .ps-hero__sub { margin-top: 4px; }
.audit-shell--compact .ps-hero__glow { opacity: 0.35; width: 200px; height: 200px; }
.audit-shell--compact .ps-body { padding-top: 12px; }
.ra-kpi-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.ra-kpi-strip .stat-box { padding: 8px 10px; }
.ra-kpi-strip .stat-box .v { font-size: 18px; }
.ra-recent-table { max-height: min(52vh, 560px); overflow: auto; }
.ra-filters input, .ra-filters select { min-height: 32px; }
@media (max-width: 1280px) {
  .ra-kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ra-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 协同动态过长时内部滚动，避免把整行栅格撑高 */
.wb-feed { max-height: 430px; overflow-y: auto; }
.wb-feed::-webkit-scrollbar { width: 5px; }
.wb-feed::-webkit-scrollbar-thumb { background: #dfe4ec; border-radius: 4px; }

/* 自动采购规则面板 */
.rule-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 14px; margin-bottom: 4px;
}
.rule-field { margin-bottom: 10px; }
.rule-field > span { font-weight: 500; }
.rule-field .field-hint { min-height: 15px; }
.rule-field .mono-hint {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; color: #9aa4b5;
}

/* 自动采购：京小洁筛选 vs 客服整合后续限制 */
.purchase-zone {
  margin-top: 12px;
  border: 1px solid var(--ps-line, var(--border-soft));
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.purchase-zone + .purchase-zone { margin-top: 14px; }
.purchase-zone__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ps-line, var(--border-soft));
}
.purchase-zone--jxj .purchase-zone__head {
  background: linear-gradient(110deg, rgba(11, 155, 184, 0.08), rgba(244, 247, 251, 0.9) 55%, #fff);
}
.purchase-zone--hub .purchase-zone__head {
  background: linear-gradient(110deg, rgba(37, 99, 235, 0.07), rgba(244, 247, 251, 0.9) 55%, #fff);
}
.purchase-zone__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ps-ink, var(--dark));
  letter-spacing: 0.01em;
}
.purchase-zone__sub {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ps-slate, var(--muted));
}
.purchase-zone__body { padding: 12px 14px 14px; }
.purchase-zone__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--ps-line, var(--border-soft));
}
.purchase-zone__chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.purchase-zone--jxj .purchase-zone__chip {
  color: #0b6f84;
  background: rgba(11, 155, 184, 0.12);
}
.purchase-zone--hub .purchase-zone__chip {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
}
.hub-rule-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.purchase-zone .section-kicker {
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.purchase-zone .section-kicker:first-child { margin-top: 0; }
.code-block {
  margin: 10px 0 0; padding: 12px 14px; background: #1f2a40; color: #d8e0ee;
  border-radius: var(--radius); font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; line-height: 1.7; overflow-x: auto; max-height: 380px;
}
.purchase-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1300px) { .purchase-split { grid-template-columns: 1fr; } }

/* 供应链整页已改用售前同款 .presale-shell / .ps-*；旧 supply-* 面板样式移除 */
.timeline { position: relative; padding-left: 16px; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border);
}
.timeline-item { position: relative; padding: 0 0 14px 4px; }
.timeline-item::before {
  content: ''; position: absolute; left: -16px; top: 4px; width: 9px; height: 9px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand);
}
.timeline-item.done::before { border-color: var(--green); background: var(--green); }
.timeline-item.reject::before { border-color: var(--red); background: var(--red); }
.timeline-item.wait::before { border-color: var(--border); }
.timeline-title { font-size: 12px; font-weight: 600; }
.timeline-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.timeline-text { font-size: 12px; color: var(--text-soft); margin-top: 4px; line-height: 1.6; }

/* ---------------------------------------------------------- 抽屉与弹窗 */

.drawer-mask, .modal-mask {
  position: fixed; inset: 0; background: var(--ui-mask); z-index: 60;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 96vw;
  background: var(--ui-canvas); z-index: 61; display: flex; flex-direction: column;
  animation: slide 0.18s ease; box-shadow: -8px 0 32px rgba(0, 0, 0, 0.28);
  color: var(--ui-text-primary);
}
.drawer-head {
  background: var(--ui-modal-surface); border-bottom: 1px solid var(--border); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.drawer-head h3 { margin: 0; font-size: 14px; color: var(--ui-text-primary); }
.drawer-head .spacer { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; }
.drawer-foot {
  background: var(--ui-modal-surface); border-top: 1px solid var(--border); padding: 10px 14px;
  display: flex; justify-content: flex-end; gap: 8px;
}
.close-x {
  border: 0; background: transparent; font-size: 18px; color: var(--muted);
  cursor: pointer; line-height: 1; padding: 2px 6px;
}
.close-x:hover { color: var(--text); }

.modal {
  position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 520px; max-width: 94vw; max-height: 88vh; background: var(--ui-modal-surface);
  border-radius: var(--ui-radius-card); border: 1px solid var(--ui-border);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--ui-shadow-card);
  color: var(--ui-text-primary);
}
.modal-head { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 14px; flex: 1; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.detail-item .k { font-size: 11px; color: var(--muted); }
.detail-item .v { font-size: 12px; margin-top: 3px; word-break: break-all; }
.detail-block { font-size: 12px; line-height: 1.7; color: var(--text-soft); white-space: pre-wrap; }

/* ---------------------------------------------------------- 责权矩阵 */

.matrix-wrap { overflow: auto; max-height: calc(100vh - 240px); }
table.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--border-soft); padding: 7px 10px; }
table.matrix thead th {
  position: sticky; top: 0; background: var(--ui-table-head); z-index: 2; text-align: center;
  border-bottom: 1px solid var(--border); font-weight: 600; min-width: 84px;
  color: var(--ui-text-secondary);
}
table.matrix thead th:first-child { text-align: left; left: 0; z-index: 3; min-width: 220px; }
table.matrix tbody th {
  position: sticky; left: 0; background: var(--ui-surface); text-align: left; font-weight: 400; z-index: 1;
  color: var(--ui-text-primary);
}
table.matrix tbody tr:hover th, table.matrix tbody tr:hover td { background: var(--ui-table-hover); }
table.matrix td { text-align: center; color: var(--ui-text-primary); }
.matrix-module th { background: var(--ui-surface-subtle) !important; font-weight: 600 !important; color: var(--text); }
.perm-name { font-size: 12px; }
.perm-code { font-size: 10px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }

.role-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px;
  background: var(--ui-surface); cursor: pointer; color: var(--ui-text-primary);
}
.role-card.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(47, 126, 240, 0.12); }
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1200px) { .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------- Toast */

.toast-root {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: #1f2a40; color: #fff; padding: 8px 16px; border-radius: 6px;
  font-size: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24); animation: fade 0.15s ease;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

.loading { text-align: center; color: var(--muted); padding: 40px 0; font-size: 12px; }

.stale-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 95;
  display: flex; align-items: center; gap: 12px; background: #1f2a40; color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
  max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center;
}
.stale-banner .btn { background: #fff; border-color: #fff; }

/* ---------------------------------------------------------- 桌面宽屏层次 */

@media (min-width: 1200px) {
  .sidebar { width: 200px; flex-basis: 200px; }
  .content { padding: 18px 22px 10px; }
  .card-body { padding: 14px 16px; }
  .toolbar { padding: 12px 14px; gap: 10px; }
  .wb-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
  .dash-split { gap: 16px; }
  .purchase-split { gap: 20px; }
}

@media (min-width: 1600px) {
  .content { padding: 20px 28px 12px; }
  .kpi-grid { gap: 14px; }
  .chart-grid { gap: 16px; }
}

/* ---------------------------------------------------------- 工商违约看板（企业级运维看板） */

/* 工商违约看板内容区：挂在售前同款 .presale-shell / .ps-* 壳内 */
.presale-shell .biz-dash-split {
  margin-top: 0;
}

.biz-dash {
  --biz-ink: #152033;
  --biz-slate: #5c6b82;
  --biz-line: #e2e8f2;
  --biz-soft: #f5f7fb;
  --biz-warn: #c98512;
  --biz-info: #2f6fdb;
  --biz-danger: #d6453d;
  --biz-ok: #0f9a6a;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: biz-dash-in 0.28s ease-out;
}

@keyframes biz-dash-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.biz-dash-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 4px 2px 2px;
}

.biz-dash-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--biz-slate);
  font-weight: 600;
  margin-bottom: 4px;
}

.biz-dash-hero-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.biz-dash-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--biz-ink);
  line-height: 1.2;
}

.biz-dash-date {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid #d7e0ef;
  background: #fff;
  color: var(--biz-info);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
}

.biz-dash-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--biz-slate);
  line-height: 1.5;
}

.biz-dash-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.biz-dash-meta-item {
  min-width: 96px;
  text-align: right;
}

.biz-dash-meta-k {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.biz-dash-meta-v {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--biz-ink);
  font-variant-numeric: tabular-nums;
}

.biz-dash-meta-v.is-ok { color: var(--biz-ok); }
.biz-dash-meta-v.is-bad { color: var(--biz-danger); }

.biz-dash-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafe 100%);
  border: 1px solid var(--biz-line);
  border-radius: 10px;
}

.biz-dash-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  min-width: 0;
}

.biz-dash-field-label {
  font-size: 11px;
  color: var(--biz-slate);
  font-weight: 600;
}

.biz-dash-select,
.biz-dash-locked {
  width: 100%;
  height: 34px;
  border: 1px solid #d5deec;
  border-radius: 6px;
  background: #fff;
  color: var(--biz-ink);
  font-size: 12.5px;
  padding: 0 10px;
}

.biz-dash-locked {
  display: flex;
  align-items: center;
  font-weight: 600;
  background: var(--biz-soft);
}

.biz-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.biz-kpi {
  position: relative;
  background: #fff;
  border: 1px solid var(--biz-line);
  border-radius: 10px;
  padding: 12px 12px 11px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.biz-kpi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #c5cedd;
}

.biz-kpi:hover {
  border-color: #c9d5e8;
  transform: translateY(-1px);
}

.biz-kpi.tone-warn::before { background: var(--biz-warn); }
.biz-kpi.tone-info::before { background: var(--biz-info); }
.biz-kpi.tone-danger::before { background: var(--biz-danger); }
.biz-kpi.tone-ok::before { background: var(--biz-ok); }
.biz-kpi.tone-neutral::before { background: #7d8aa0; }

.biz-kpi-label {
  font-size: 11px;
  color: var(--biz-slate);
  font-weight: 600;
}

.biz-kpi-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--biz-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.biz-kpi.tone-warn .biz-kpi-value { color: #b56f08; }
.biz-kpi.tone-info .biz-kpi-value { color: #1f5fc4; }
.biz-kpi.tone-danger .biz-kpi-value { color: var(--biz-danger); }
.biz-kpi.tone-ok .biz-kpi-value { color: var(--biz-ok); }

.biz-kpi-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.biz-dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 12px;
  align-items: stretch;
}

.biz-reason-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.biz-reason-company__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.biz-reason-company__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--biz-ink, #0f172a);
}

.biz-reason-company__meta {
  font-size: 12px;
  color: var(--muted);
}

.biz-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.biz-detail-row {
  min-width: 0;
}

.biz-detail-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.biz-detail-value {
  font-size: 13px;
  color: var(--biz-ink, #0f172a);
  word-break: break-word;
}

@media (max-width: 720px) {
  .biz-detail-grid {
    grid-template-columns: 1fr;
  }
}

.biz-panel {
  background: #fff;
  border: 1px solid var(--biz-line);
  border-radius: 10px;
  padding: 12px 14px 14px;
  min-width: 0;
}

.biz-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f8;
}

.biz-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--biz-ink);
}

.biz-panel-hint {
  font-size: 11px;
  color: var(--muted);
}

.biz-panel-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--biz-slate);
  margin-bottom: 8px;
}

.biz-rank {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.biz-rank-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: var(--biz-soft);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.biz-rank-row:hover {
  background: #eef4ff;
  border-color: #d5e3fb;
}

.biz-rank-row.is-static {
  cursor: default;
}

.biz-rank-row.is-static:hover {
  background: var(--biz-soft);
  border-color: transparent;
}

.biz-rank-idx {
  flex: 0 0 auto;
  width: 28px;
  font-size: 12px;
  font-weight: 700;
  color: #8a96ab;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.biz-rank-main { flex: 1; min-width: 0; }

.biz-rank-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.biz-rank-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--biz-ink);
}

.biz-rank-amt {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--biz-ink);
  font-variant-numeric: tabular-nums;
}

.biz-rank-bar {
  margin-top: 6px;
  height: 5px;
  border-radius: 99px;
  background: #e6ebf3;
  overflow: hidden;
}

.biz-rank-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #245fd8, #5b8aef);
}

.biz-rank-foot {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.biz-rank-foot .is-warn { color: var(--biz-danger); font-weight: 600; }

.biz-rank-id {
  margin-top: 3px;
  font-size: 10.5px;
  color: #9aa6b8;
}

.biz-focus {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.biz-focus-block {
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafd 0%, #f3f6fb 100%);
  border: 1px solid #e8eef7;
}

.biz-focus-label {
  font-size: 11px;
  color: var(--biz-slate);
  font-weight: 600;
}

.biz-focus-value {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.biz-focus-value b {
  font-size: 28px;
  font-weight: 750;
  color: var(--biz-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.biz-focus-value span {
  font-size: 12px;
  color: var(--muted);
}

.biz-focus-track {
  margin-top: 10px;
  height: 8px;
  border-radius: 99px;
  background: #e4eaf3;
  overflow: hidden;
}

.biz-focus-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #245fd8, #5b8aef);
  transition: width 0.35s ease;
}

.biz-focus-fill.is-hot {
  background: linear-gradient(90deg, #d6453d, #ef7a55);
}

.biz-focus-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.biz-focus-split-nums {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.biz-focus-split-nums span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.biz-focus-split-nums b {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--biz-ink);
}

.biz-health {
  border-radius: 8px;
  padding: 12px;
  border: 1px solid transparent;
}

.biz-health.is-ok {
  background: #f2fbf7;
  border-color: #d5efe4;
}

.biz-health.is-bad {
  background: #fff7f6;
  border-color: #f3d4d1;
}

.biz-health-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--biz-ink);
}

.biz-health.is-ok .biz-health-title { color: var(--biz-ok); }
.biz-health.is-bad .biz-health-title { color: var(--biz-danger); }

.biz-health-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.biz-health-grid span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.biz-health-grid b {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.biz-health-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--biz-slate);
}

.biz-health-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.biz-health-item,
.biz-health-more {
  font-size: 11.5px;
  color: var(--text-soft);
  line-height: 1.4;
}

.biz-health-more { color: var(--muted); }

.biz-table-wrap {
  margin: 0 -4px;
}

.biz-table-wrap .table-wrap,
.biz-table-wrap table.data {
  border: 0;
  box-shadow: none;
}

.biz-table-wrap table.data th {
  background: #f6f8fc;
  color: var(--biz-slate);
  font-weight: 650;
  font-size: 11px;
}

.biz-table-wrap table.data td {
  font-size: 12.5px;
  border-color: #eef2f8;
}

.biz-cell-stack { min-width: 0; }
.biz-cell-primary { font-weight: 600; color: var(--biz-ink); }
.biz-cell-secondary {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.biz-num {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--biz-ink);
}

.biz-link {
  border: 0;
  background: transparent;
  color: var(--biz-info);
  font-weight: 650;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
}

.biz-link:hover { text-decoration: underline; }

.biz-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 650;
  border: 1px solid transparent;
}

.biz-tag.is-delay {
  color: #9a6808;
  background: #fff7e8;
  border-color: #f0dfb4;
}

.biz-tag.is-other {
  color: #1f5fc4;
  background: #eef4ff;
  border-color: #d5e3fb;
}

.biz-tag.is-follow {
  color: #c0392f;
  background: #fff1f0;
  border-color: #f0c9c5;
}

.biz-back-btn { margin-left: 2px; }

.biz-struct-track {
  margin-top: 12px;
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: #e4eaf3;
}

.biz-struct-delay { background: linear-gradient(90deg, #b9853b, #d4a85e); }
.biz-struct-other { background: linear-gradient(90deg, #245fd8, #5b8aef); }

.biz-kind-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.biz-kind-row {
  padding: 10px 11px;
  border-radius: 8px;
  background: var(--biz-soft, #f5f7fb);
  border: 1px solid transparent;
}

.biz-kind-row.is-delay { border-color: #f0dfb4; }
.biz-kind-row.is-other { border-color: #d5e3fb; }

.biz-kind-top,
.biz-kind-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.biz-kind-name {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--biz-ink, #152033);
}

.biz-kind-count {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--biz-ink, #152033);
}

.biz-kind-bar {
  margin-top: 7px;
  height: 6px;
  border-radius: 99px;
  background: #e6ebf3;
  overflow: hidden;
}

.biz-kind-bar-fill {
  height: 100%;
  border-radius: 99px;
}

.biz-kind-row.is-delay .biz-kind-bar-fill {
  background: linear-gradient(90deg, #b9853b, #d4a85e);
}

.biz-kind-row.is-other .biz-kind-bar-fill {
  background: linear-gradient(90deg, #245fd8, #5b8aef);
}

.biz-kind-foot {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1280px) {
  .biz-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .biz-dash-split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .biz-dash-controls { grid-template-columns: 1fr 1fr; }
  .biz-dash-hero { flex-direction: column; align-items: flex-start; }
  .biz-dash-meta { justify-content: flex-start; }
  .biz-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-kpi-value { font-size: 20px; }
}

/* ---------------------------------------------------------- 手机 / 窄屏壳子 */

@media (max-width: 900px) {
  html, body { font-size: 14px; overflow-x: hidden; }
  body.nav-open { overflow: hidden; }

  /* 登录页窄屏样式已在 .login-page 专属媒体查询中处理；此处仅保留壳层 */
  .login-page .login-form input { font-size: 16px; } /* 避免 iOS 自动放大 */
  .btn-block { height: 44px; font-size: 15px; }

  .app { display: block; min-height: 100vh; min-height: 100dvh; }
  .main { min-height: 100vh; min-height: 100dvh; }

  .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 45;
    background: rgba(17, 24, 39, 0.46);
  }
  .sidebar-backdrop[hidden] { display: none !important; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(288px, 86vw);
    min-width: 0;
    max-width: none;
    flex: none;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 28px rgba(32, 53, 77, 0.12);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .sidebar-brand { padding-right: 10px; }
  .sidebar-collapse { display: none !important; }
  .sidebar-close {
    display: grid; place-items: center;
    margin-left: auto;
    width: 36px; height: 36px;
    border: 0; border-radius: var(--sidebar-radius);
    background: transparent; color: var(--sidebar-text-secondary);
    font-size: 22px; line-height: 1; cursor: pointer;
  }
  .sidebar-close:hover { background: var(--sidebar-bg-hover); color: var(--sidebar-text-primary); }
  .sidebar-close:focus { outline: none; }
  .sidebar-close:focus-visible {
    outline: 2px solid var(--sidebar-focus);
    outline-offset: 1px;
  }

  .sidebar .nav-item { height: 42px; min-height: 42px; padding: 0 12px; font-size: 14px; }
  .sidebar .nav-subitem { height: 38px; min-height: 38px; padding: 0 10px 0 12px; font-size: 13px; }
  .sidebar-footer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar-logout {
    height: 42px;
    min-height: 42px;
    font-size: 13px;
  }

  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: 0 0 44px;
    border: 1px solid var(--border); border-radius: 8px;
    background: #fff; cursor: pointer; padding: 0;
  }
  .menu-toggle-bars,
  .menu-toggle-bars::before,
  .menu-toggle-bars::after {
    display: block; width: 16px; height: 2px; background: var(--text);
    border-radius: 1px; position: relative;
  }
  .menu-toggle-bars::before,
  .menu-toggle-bars::after {
    content: ''; position: absolute; left: 0;
  }
  .menu-toggle-bars::before { top: -5px; }
  .menu-toggle-bars::after { top: 5px; }

  .topbar {
    height: auto; min-height: 52px;
    padding: 8px 10px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .topbar-left { gap: 8px; }
  .topbar-center { display: none; }
  .topbar-titles { flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
  .topbar h2 { font-size: 15px; max-width: none; }
  .topbar-sub { font-size: 11px; max-width: 100%; }
  .topbar-right { gap: 6px; flex-shrink: 0; flex-wrap: nowrap; }
  .topbar-clock { display: none; }
  .icon-btn { width: 40px; height: 40px; font-size: 17px; border-radius: 8px; }
  .user-chip { padding: 3px; border-radius: 50%; }
  .user-meta { display: none; }
  .user-avatar { width: 32px; height: 32px; font-size: 13px; }

  .content {
    padding: 12px 10px 8px;
    overflow-x: hidden;
  }
  .footer {
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px));
    font-size: 11px; line-height: 1.5;
  }

  .card { margin-bottom: 10px; }
  .card-head {
    flex-wrap: wrap; gap: 8px;
    padding: 12px;
  }
  .card-head h3 { font-size: 14px; }
  .card-body { padding: 12px; }
  .toolbar {
    padding: 10px; gap: 8px;
    align-items: stretch;
  }
  .toolbar .btn,
  .toolbar .btn-sm,
  .card-head .btn,
  .card-head .btn-sm {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }
  .toolbar-label { width: 100%; line-height: 1.45; }

  .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .btn-sm { min-height: 34px; padding: 0 10px; font-size: 12px; }
  /* 表格操作列保持紧凑横排，不受移动端按钮增高影响 */
  .table-actions .btn,
  .table-actions .btn-sm {
    min-height: 0;
    height: 24px;
    padding: 0 9px;
    font-size: 11px;
  }
  input, select, textarea {
    font-size: 16px; /* 避免 iOS 聚焦放大 */
    min-height: 40px;
    padding: 0 10px;
  }
  textarea { min-height: 88px; padding: 8px 10px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  label.field { margin-bottom: 14px; }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 0;
    margin-left: -2px;
    margin-right: -2px;
    padding-bottom: 1px;
  }
  .tab {
    flex: 0 0 auto;
    padding: 10px 12px;
    min-height: 40px;
    white-space: nowrap;
  }
  .chip { padding: 6px 12px; font-size: 12px; min-height: 32px; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { min-height: 72px; padding: 12px; }
  .kpi-value { font-size: 20px; }
  .kpi-chart { display: none; }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
  }
  table.data { min-width: 560px; }
  table.data th, table.data td { padding: 10px 10px; }
  .pager {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }
  .pager .btn { min-height: 36px; }

  .stat-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-box .v { font-size: 18px; }

  .dept-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .dept-row .dept-main { min-width: 0; width: 100%; }
  .dept-row .dept-stats { width: 100%; gap: 10px; }
  .dept-row .dept-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }

  .rule-grid { grid-template-columns: 1fr; gap: 0; }
  .purchase-split { gap: 12px; }
  .code-block { font-size: 11px; max-height: 280px; }

  .detail-grid { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .matrix-wrap { max-height: none; }
  table.matrix thead th:first-child,
  table.matrix tbody th { min-width: 140px; }

  .drawer {
    width: 100%;
    max-width: 100%;
  }
  .drawer-head, .drawer-foot, .modal-head, .modal-foot {
    padding-left: 12px; padding-right: 12px;
  }
  .drawer-foot, .modal-foot {
    flex-wrap: wrap;
    gap: 8px;
  }
  .drawer-foot .btn, .modal-foot .btn {
    min-height: 40px; flex: 1 1 auto; justify-content: center;
  }
  .modal {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 12px;
  }
  .presale-shell { min-height: auto; }

  .toast-root {
    left: 12px; right: 12px; transform: none; width: auto; align-items: stretch;
    top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .toast { text-align: center; font-size: 13px; padding: 10px 14px; }

  .ellipsis { max-width: 180px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar-clock__icon { display: none; } /* 小屏压缩时钟，版本仍在侧栏底部 */
  .login-page .login-brand-header { gap: 10px; }
}

/* ---------------------------------------------------------- 售前作战看板 */

.presale-shell {
  --ps-ink: #1d2433;
  --ps-slate: #667085;
  --ps-line: #e2e6ec;
  --ps-soft: #f8fafc;
  --ps-cyan: #218a7a;
  --ps-amber: #b9853b;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 247, 251, 0.96) 100%);
  border: 1px solid var(--ps-line);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  min-height: calc(100vh - 168px);
}

/* 业务头：浅色珍珠灰冷光；深色用 --ui-hero-* 令牌。禁止 #0078D7 横幅。 */
.ps-hero {
  position: relative;
  padding: 22px 22px 0;
  background:
    radial-gradient(
      80% 170% at 10% -20%,
      var(--ui-hero-glow) 0%,
      rgba(75, 125, 230, 0.08) 38%,
      rgba(75, 125, 230, 0) 68%
    ),
    linear-gradient(
      180deg,
      var(--ui-hero-from) 0%,
      var(--ui-hero-to) 100%
    );
  color: var(--ui-text-primary);
  overflow: hidden;
  border-bottom: 1px solid var(--ui-border-soft);
}

.ps-hero__glow {
  position: absolute;
  inset: auto -10% -40% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 95, 216, 0.08), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  animation: ps-drift 8s ease-in-out infinite alternate;
  opacity: 0.55;
}

.ps-hero__row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.ps-hero__eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--ui-text-muted);
  margin-bottom: 6px;
}

.ps-hero__title {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ui-text-primary);
}

.ps-hero__sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ui-text-secondary);
  max-width: 420px;
}

.ps-hero__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.ps-hero__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* .ps-guide-btn 共用下方「Hero 使用说明入口」样式（售前/售中/采购一致） */

/* 采购 MODULE GUIDE 抽屉（对齐售前风格；功能说明手风琴 + 最近更新） */
.mg-drawer {
  width: min(440px, 96vw);
  background: #f5f7fb;
}
.mg-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
}
.mg-drawer__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand);
  margin-bottom: 6px;
}
.mg-drawer__title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  color: var(--dark);
  line-height: 1.25;
}
.mg-drawer__body { padding: 14px 16px 28px; }
.mg-drawer__intro {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
}
.mg-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 8px;
}
.mg-acc { display: flex; flex-direction: column; gap: 8px; }
.mg-acc__row {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}
.mg-acc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.mg-acc__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}
.mg-acc__toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}
.mg-acc__toggle:hover { color: var(--brand); }
.mg-acc__body {
  padding: 0 14px 12px;
  border-top: 1px solid var(--border-soft);
}
.mg-acc__list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.55;
}
.mg-acc__list li { margin: 4px 0; }
.mg-updates__box {
  background: #eef1f6;
  border-radius: 12px;
  padding: 12px 14px;
}
.mg-updates__item + .mg-updates__item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}
.mg-updates__meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 4px;
}
.mg-updates__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark);
}
.mg-updates__box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}
.mg-updates__box li { margin: 3px 0; }
.mg-drawer__print {
  margin-top: 14px;
  text-align: right;
}
.mg-print-link {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.mg-print-link:hover { text-decoration: underline; }

.ps-hero__meta {
  font-size: 12px;
  color: var(--ui-text-secondary);
}

.ps-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.ps-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--ui-radius-control);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  color: var(--ui-text-secondary);
  font-size: 12px;
}

/* Hero「使用说明」入口（各部门可复用 .ps-guide-btn） */
.ps-guide-btn {
  appearance: none;
  border: 1px solid #DDE3EA;
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  border-radius: var(--ui-radius-control);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.4;
}
.ps-guide-btn:hover {
  border-color: #B9C5D4;
  color: var(--ui-primary);
  background: var(--ui-primary-soft);
}

/* 模块使用说明抽屉 */
.mod-guide {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}
.mod-guide__mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}
.mod-guide__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 28px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
}
.mod-guide__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}
.mod-guide__eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 650;
  color: #64748b;
  margin-bottom: 4px;
}
.mod-guide__title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  color: #0f172a;
}
.mod-guide__close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 0 4px;
}
.mod-guide__scroll {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 28px;
}
.mod-guide__loading,
.mod-guide__empty {
  color: #64748b;
  font-size: 13px;
}
.mod-guide__summary {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #334155;
}
.mod-guide__hint {
  margin: 0 0 16px;
  font-size: 12px;
  color: #64748b;
}
.mod-guide__block { margin-bottom: 22px; }
.mod-guide__h {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 750;
  color: #0f172a;
}
.mod-guide__sec {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
}
.mod-guide__sec-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.mod-guide__sec-summary::-webkit-details-marker { display: none; }
.mod-guide__sec-summary:hover { background: #f8fafc; }
.mod-guide__sec[open] > .mod-guide__sec-summary {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #f8fafc;
}
.mod-guide__sec-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.mod-guide__sec-chevron {
  flex: 0 0 auto;
  font-size: 12px;
  color: #64748b;
}
.mod-guide__sec-chevron::after { content: '展开'; }
.mod-guide__sec[open] .mod-guide__sec-chevron { color: #2563eb; }
.mod-guide__sec[open] .mod-guide__sec-chevron::after { content: '收起'; }
.mod-guide__sec-body { padding: 12px 12px 14px; }
.mod-guide__what {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}
.mod-guide__how {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}
.mod-guide__how li { margin-bottom: 4px; }
.mod-guide__sheet-path {
  margin: 0 0 8px;
  font-size: 12px;
  color: #64748b;
}
.mod-guide__principle {
  margin: 0 0 12px;
  padding: 8px 10px;
  background: #f1f5f9;
  border-left: 3px solid #0f172a;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
  color: #0f172a;
}
.mod-guide__sheet-block { margin-bottom: 12px; }
.mod-guide__sheet-h {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 750;
  color: #0f172a;
}
.mod-guide__sheet-h--warn { color: #8b1e1e; }
.mod-guide__red { color: #8b1e1e; font-weight: 650; }
.mod-guide__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.mod-guide__table th,
.mod-guide__table td {
  border: 1px solid #dbe1ea;
  padding: 5px 6px;
  vertical-align: top;
  text-align: left;
  line-height: 1.4;
}
.mod-guide__table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
}
.mod-guide__table th:first-child,
.mod-guide__table td:first-child { width: 42px; white-space: nowrap; }
.mod-guide__bullets {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
}
.mod-guide__bullets li { margin-bottom: 3px; }
.mod-guide__print-line {
  margin: 4px 0 0;
  font-size: 12px;
}
.mod-guide__print-link {
  color: #2563eb;
  text-decoration: none;
}
.mod-guide__print-link:hover { text-decoration: underline; }
.mod-guide__update {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 8px;
}
.mod-guide__update-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 2px;
}
.mod-guide__update-meta {
  font-size: 12px;
  color: #64748b;
}
.mod-guide__update-title {
  font-size: 13px;
  font-weight: 650;
  color: #0f172a;
  margin-bottom: 4px;
}
.mod-guide__update-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
}

.ps-live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3dd68c;
  box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.55);
  animation: ps-pulse 1.8s ease-out infinite;
}

.ps-nav {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 0;
  border-bottom: 1px solid var(--ui-border);
}

.ps-nav__item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #344054;
  padding: 12px 14px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 108px;
  border-bottom: 2px solid transparent;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ps-nav__item:hover {
  color: var(--ui-primary);
  background: var(--ui-surface-hover);
}

.ps-nav__item.is-active {
  color: var(--ui-primary);
  border-bottom-color: var(--ui-primary);
  background: transparent;
  font-weight: 500;
}

.ps-nav__label {
  font-size: 13px;
  font-weight: 650;
}

.ps-nav__hint {
  font-size: 11px;
  color: var(--ui-text-muted);
  opacity: 1;
}

/* 各部门业务头：统一浅色冷光（见 .ps-hero）；.ps-hero--* 仅作钩子，勿盖深蓝/#0078D7 */

.ps-body {
  padding: 18px 20px 22px;
}

.ps-fade {
  animation: ps-enter 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ps-tab { min-height: 240px; }

.ps-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ps-section-head__left,
.ps-section-head__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ps-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ps-ink);
}

.ps-lead {
  margin: 0 0 14px;
  color: var(--ps-slate);
  font-size: 12.5px;
  line-height: 1.55;
}

.ps-meta {
  font-size: 12px;
  color: var(--muted);
}

.ps-panel {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--ps-line);
}

.ps-panel--brand {
  background:
    linear-gradient(135deg, rgba(47, 126, 240, 0.06), transparent 42%),
    #fff;
}

.ps-panel--cyan {
  background:
    linear-gradient(135deg, rgba(11, 155, 184, 0.07), transparent 42%),
    #fff;
}

.ps-panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ps-panel__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ps-ink);
}

.ps-panel__meta {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.ps-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.ps-kpi-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ps-kpi-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ps-sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  margin-bottom: 12px;
}
.ps-sync-banner--ok { background: #f3fbf7; border-color: #b7e5cf; }
.ps-sync-banner--warn { background: #fff8f1; border-color: #f0d0a8; }
.ps-sync-banner--muted,
.ps-sync-banner--empty { background: #f8fafc; }
.ps-sync-banner__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}
.ps-sync-banner__label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.ps-sync-banner__summary {
  font-size: 13.5px;
  color: #0f172a;
}
.ps-sync-banner__meta {
  font-size: 12px;
  color: #94a3b8;
}
.ps-fail-shop-list {
  margin: 8px 0 0;
  padding-left: 18px;
  max-height: 320px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.55;
}
.ps-panel--issues {
  margin-top: 12px;
}
.ps-issues__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.ps-issues__titles {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}
.ps-issues__body {
  position: relative;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ps-soft, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.ps-issues__body.is-empty .ps-issues__text {
  color: #94a3b8;
}
.ps-issues__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.ps-issues__more {
  appearance: none;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 650;
  padding: 6px 0 0;
  cursor: pointer;
}
.ps-issues__more:hover { text-decoration: underline; }
.ps-issues__foot {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}
.ps-issue-full {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: #0f172a;
}
.ps-input--area {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font: inherit;
  line-height: 1.5;
}
.ps-muted {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #64748b;
}

.ps-kpi {
  position: relative;
  padding: 12px 12px 10px;
  border-radius: 10px;
  background: var(--ps-soft);
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ps-kpi::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
  opacity: 0.85;
}

.ps-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  border-color: rgba(47, 126, 240, 0.16);
}

.ps-kpi--brand::before { background: var(--brand); }
.ps-kpi--cyan::before { background: var(--ps-cyan); }
.ps-kpi--warn::before { background: var(--ps-amber); }
.ps-kpi--ok::before { background: var(--green); }
.ps-kpi--neutral::before { background: #94a3b8; }
.ps-kpi--muted::before { background: #cbd5e1; }

.ps-kpi--clickable {
  cursor: pointer;
}

.ps-kpi--clickable:focus-visible {
  outline: 2px solid rgba(47, 126, 240, 0.45);
  outline-offset: 2px;
}

.ps-kpi__hint--action {
  color: var(--brand);
}

.ps-kpi__label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ps-kpi__value,
.ps-countdown {
  font-size: 20px;
  font-weight: 740;
  color: var(--ps-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ps-kpi__hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.ps-contact-select {
  min-width: 96px;
  height: 30px;
  font-size: 12px;
}

.ps-phone-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.ps-phone-cell .btn {
  flex: 0 0 auto;
}

.ps-kpi--live .ps-countdown {
  color: var(--brand);
}

.ps-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--ps-line);
}

.ps-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ps-input {
  width: 120px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.ps-input--sm { width: 72px; }
.ps-input--date { width: 142px; }
.ps-input:disabled { background: #f6f7fa; color: var(--muted); }

.ps-toolbar--dash {
  margin-top: 0;
  flex-wrap: wrap;
  gap: 10px;
}

.ps-panel--chart { padding-bottom: 8px; }
.ps-panel--clickable {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ps-panel--clickable:hover {
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.ps-panel__meta--link {
  margin-left: auto;
  color: #1d4ed8;
  font-weight: 600;
}
.ps-field--grow { flex: 1 1 160px; min-width: 140px; }

/* 售前总览：一整块「整体看板」左数右结论 */
.ps-ovboard {
  padding: 0;
  overflow: hidden;
}
.ps-ovboard__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ps-line);
  background:
    linear-gradient(180deg, rgba(29, 78, 216, 0.04), transparent 70%),
    #fff;
}
.ps-ovboard__head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.ps-ovboard__head-left .ps-panel__meta {
  margin-left: 0;
}
.ps-ovboard__body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.95fr);
  align-items: stretch;
  min-width: 0;
}
.ps-ovboard__metrics {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}
.ps-ovboard__analysis {
  min-width: 0;
  padding: 12px 14px;
  border-left: 1px solid var(--ps-line);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.015), transparent 55%),
    #fbfdff;
}
.ps-ovboard__part {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
}
.ps-ovboard__part--brand {
  background:
    linear-gradient(135deg, rgba(47, 126, 240, 0.05), transparent 48%),
    #fff;
}
.ps-ovboard__part--cyan {
  background:
    linear-gradient(135deg, rgba(11, 155, 184, 0.06), transparent 48%),
    #fff;
}
.ps-ovboard__part.is-clickable {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ps-ovboard__part.is-clickable:hover {
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
.ps-ovboard__part-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ps-ovboard__part-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-ink);
}
.ps-ovboard__col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-ink);
  margin-bottom: 8px;
}
.ps-ovboard__insights {
  min-width: 0;
  max-height: min(68vh, 520px);
  overflow: auto;
}
.ps-ovboard__insights.is-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 0;
}

.ps-insights {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--ps-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(29, 78, 216, 0.04), transparent 60%),
    #fff;
}
.ps-insights--empty {
  color: var(--muted);
  font-size: 13px;
}
.ps-insights__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-ink);
  margin-bottom: 8px;
}
.ps-insights__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.ps-insights__item {
  position: relative;
  padding: 6px 10px 6px 28px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  background: #f8fafc;
  color: var(--ps-ink);
}
.ps-insights__item::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}
.ps-insights__item--ok::before { background: #059669; }
.ps-insights__item--warn::before { background: #d97706; }
.ps-insights__item--info::before { background: #2563eb; }

.ps-agent-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--ps-line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.ps-agent-table__head,
.ps-agent-table__row {
  display: grid;
  grid-template-columns: 56px minmax(72px, 1.1fr) repeat(6, minmax(72px, 1fr));
  align-items: center;
}
.ps-agent-table__head {
  background: #0f766e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.ps-agent-table__th,
.ps-agent-table__td {
  padding: 10px 8px;
  text-align: center;
}
.ps-agent-table__th:nth-child(2),
.ps-agent-table__td.name { text-align: left; }
.ps-agent-table__row:nth-child(even) { background: #f8fafc; }
.ps-agent-table__row.is-top { background: #fffbeb; }
.ps-agent-table__td.rank { font-weight: 700; color: #64748b; }
.ps-agent-table__td.rank.is-top { color: #ca8a04; }
.ps-agent-table__td.name { font-weight: 600; }
.ps-agent-table__td.cvr { color: #059669; font-weight: 700; }

@media (max-width: 900px) {
  .ps-agent-table { overflow-x: auto; }
  .ps-agent-table__head,
  .ps-agent-table__row { min-width: 720px; }
}

.ps-chart { padding: 2px 0 0; }
.ps-chart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ps-chart__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ps-ink);
}
.ps-chart__legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ps-leg {
  position: relative;
  padding-left: 14px;
  font-size: 12px;
  color: var(--ps-slate);
}
.ps-leg::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #1d4ed8;
}
.ps-leg--cyan::before { background: #0f766e; }
.ps-chart__summary {
  margin-top: 8px;
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.ps-chart__body {
  background:
    radial-gradient(900px 180px at 8% 0%, rgba(29, 78, 216, 0.06), transparent 55%),
    #fff;
  border: 1px solid var(--ps-line);
  border-radius: 14px;
  padding: 10px 8px 6px;
  overflow: hidden;
}
.ps-linechart { display: block; }

.ps-banner {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.ps-banner--muted {
  background: #f3f6fb;
  color: var(--ps-slate);
}

.ps-banner--danger {
  background: #fff1f0;
  color: var(--red);
  border: 1px solid rgba(224, 72, 60, 0.18);
}

.ps-banner--warn {
  background: #fff8eb;
  color: #9a6b12;
  border: 1px solid rgba(226, 147, 15, 0.28);
}

.ps-banner--info {
  background: #eef6ff;
  color: #1f5f9a;
  border: 1px solid rgba(47, 128, 210, 0.24);
}

.ps-toolbar__meta {
  margin-left: auto;
  font-size: 12px;
  line-height: 1.4;
}

.ps-table-wrap {
  background: #fff;
  border: 1px solid var(--ps-line);
  border-radius: 12px;
  overflow: auto;
}

.ps-table-wrap--wide { max-width: 100%; }

.ps-table-wrap table {
  margin: 0;
}

/* 大额待付款：CSS Grid 八列同轨（不用 table，避免 select/金额右对齐撑歪） */
.ps-table-wrap--unpaid {
  overflow-x: auto;
}

.ps-unpaid-grid {
  --ps-unpaid-cols: minmax(140px, 1.6fr) minmax(96px, 1.1fr) minmax(88px, 0.9fr)
    minmax(140px, 1.4fr) minmax(88px, 0.85fr) minmax(72px, 0.7fr)
    minmax(132px, 1.3fr) minmax(112px, 1fr);
  min-width: 960px;
  width: 100%;
}

.ps-unpaid-grid__head,
.ps-unpaid-grid__row {
  display: grid;
  grid-template-columns: var(--ps-unpaid-cols);
  align-items: center;
  column-gap: 0;
}

.ps-unpaid-grid__head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  border-bottom: 1px solid var(--border);
}

.ps-unpaid-grid__row {
  border-bottom: 1px solid var(--border-soft);
}

.ps-unpaid-grid__row:hover {
  background: #f8fbff;
}

.ps-unpaid-grid__cell {
  min-width: 0;
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  box-sizing: border-box;
}

.ps-unpaid-grid__cell--head {
  font-weight: 600;
  color: var(--text-soft);
  background: #f7f9fc;
}

.ps-unpaid-grid__cell--contact {
  text-align: center;
}

.ps-unpaid-grid__cell--contact.ps-unpaid-grid__cell--head {
  text-align: center;
}

.ps-unpaid-grid__cell--contact .ps-contact-select {
  margin: 0 auto;
  text-align: center;
}

.ps-unpaid-grid__empty {
  padding: 34px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.ps-unpaid-grid .ellipsis {
  display: block;
  max-width: 100%;
}

.ps-unpaid-grid .ps-phone-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.ps-unpaid-grid .ps-phone-cell .mono {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-unpaid-grid .ps-contact-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ps-unpaid-grid .ps-money {
  display: inline-block;
  max-width: 100%;
}

.ps-money {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ps-ink);
}

.ps-money--profit { color: var(--green); }

.ps-empty {
  padding: 42px 20px;
  text-align: center;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(47, 126, 240, 0.04), transparent),
    #fff;
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

.ps-empty__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ps-ink);
  margin-bottom: 6px;
}

.ps-empty__desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.ps-loading {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

@keyframes ps-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ps-pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(61, 214, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0); }
}

@keyframes ps-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-18px, 10px, 0); }
}

@media (max-width: 1100px) {
  .ps-kpi-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-kpi-grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ps-ovboard__body {
    grid-template-columns: 1fr;
  }
  .ps-ovboard__analysis {
    border-left: none;
    border-top: 1px solid var(--ps-line);
  }
  .ps-ovboard__insights {
    max-height: none;
  }
}

/* 售前 SOP 手册阅读器 */
.ps-sop__search { min-width: 200px; max-width: 280px; }
.ps-sop__search .ps-input { width: 100%; }

.ps-sop__layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 0;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.98));
}

.ps-sop__nav {
  border-right: 1px solid var(--border);
  background: #f4f7fb;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(70vh, 720px);
  overflow: auto;
}

.ps-sop__nav-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 8px 8px;
  font-weight: 650;
}

.ps-sop__nav-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
  color: var(--text);
}

.ps-sop__nav-item:hover { background: rgba(255, 255, 255, 0.8); }
.ps-sop__nav-item.is-active {
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  color: var(--ps-brand, #0b5fff);
  font-weight: 650;
}

.ps-sop__nav-idx {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  padding-top: 2px;
  flex: 0 0 auto;
}

.ps-sop__nav-item.is-active .ps-sop__nav-idx { color: inherit; }

.ps-sop__nav-label {
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}

.ps-sop__nav-empty {
  padding: 16px 10px;
  color: var(--muted);
  font-size: 12px;
}

.ps-sop__article {
  padding: 22px 26px 28px;
  max-height: min(70vh, 720px);
  overflow: auto;
  background:
    radial-gradient(1200px 280px at 10% 0%, rgba(14, 116, 244, 0.06), transparent 55%),
    #fff;
}

.ps-sop__article-head {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.ps-sop__article-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ps-ink, #10233f);
}

.ps-sop__article-meta {
  margin-top: 6px;
  font-size: 12px;
}

.ps-sop__heading {
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--ps-ink, #10233f);
}

.ps-sop__p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.ps-sop-table {
  margin: 12px 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
}

.ps-sop-table__head,
.ps-sop-table__row {
  display: grid;
  grid-template-columns: repeat(var(--ps-sop-cols, 3), minmax(120px, 1fr));
}

.ps-sop-table__head {
  background: #f3f6fb;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ps-sop-table__row { border-bottom: 1px solid var(--border-soft); }
.ps-sop-table__row:last-child { border-bottom: 0; }
.ps-sop-table__row:hover { background: #f8fbff; }

.ps-sop-table__cell {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  border-right: 1px solid var(--border-soft);
}

.ps-sop-table__cell:last-child { border-right: 0; }

.ps-sop-table__cell--head {
  font-weight: 650;
  color: var(--text-soft);
  background: #f3f6fb;
}

/* 售前训练：打字 / 模拟对话 */
.ps-tab--train {
  min-height: 420px;
  margin-top: 4px;
}

.ps-train-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.ps-train-toolbar__left,
.ps-train-toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ps-train-toolbar strong {
  font-size: 15px;
  color: var(--ps-ink, #10233f);
}

.ps-train-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  gap: 14px;
}

.ps-train-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 20px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.9), #fff 40%);
}

.ps-train-card--side {
  align-self: stretch;
}

.ps-train-card__kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ps-train-card__title {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--ps-ink, #10233f);
}

.ps-train-card__desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-soft);
}

.ps-train-card__foot {
  margin-top: 12px;
  font-size: 12px;
}

.ps-btn-end {
  font-weight: 650;
}

.ps-btn-end--block {
  width: 100%;
  margin-top: 14px;
  justify-content: center;
  min-height: 40px;
}

.ps-train-sub {
  margin: 14px 0 6px;
  font-size: 13px;
}

.ps-train-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
}

.ps-board__head,
.ps-board__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.4fr) 88px 64px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}

.ps-board__head {
  color: var(--muted);
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}

.ps-board__row {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-soft);
}

.ps-board__rank { font-variant-numeric: tabular-nums; font-weight: 650; }
.ps-board__score { font-weight: 650; color: var(--ps-brand, #0b5fff); }
.ps-board__empty { padding: 18px 4px; font-size: 12px; }

.ps-typing {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  background:
    radial-gradient(900px 240px at 0% 0%, rgba(14, 116, 244, 0.07), transparent 50%),
    #fff;
  min-height: 420px;
}

.ps-typing__progress {
  height: 6px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
  margin-bottom: 14px;
}

.ps-typing__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0b5fff, #3b82f6);
  border-radius: 999px;
  transition: width 180ms ease;
}

.ps-typing__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ps-typing__prompt-label {
  font-size: 12px;
  color: var(--muted);
}

.ps-typing__meter { font-size: 12px; }
.ps-typing__meter-val { font-weight: 700; color: var(--ps-brand, #0b5fff); }

.ps-typing__prompt {
  font-size: 22px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--ps-ink, #10233f);
  margin-bottom: 8px;
  font-weight: 600;
}

.ps-typing__prompt--live {
  font-weight: 600;
  word-break: break-word;
}

.ps-typing__ch { color: var(--ps-ink, #10233f); }
.ps-typing__ch.is-ok { color: #0f766e; }
.ps-typing__ch.is-bad {
  color: #c2410c;
  background: rgba(194, 65, 12, 0.08);
  border-radius: 3px;
}
.ps-typing__ch.is-cursor {
  border-bottom: 2px solid var(--ps-brand, #0b5fff);
}
.ps-typing__ch.is-extra {
  color: #c2410c;
  text-decoration: line-through;
}

.ps-typing__cat { font-size: 12px; margin-bottom: 14px; }

.ps-typing__input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.55;
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

.ps-typing__input:focus {
  outline: none;
  border-color: rgba(11, 95, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.12);
}

.ps-typing__actions { margin-top: 12px; display: flex; justify-content: flex-end; }

.ps-typing-detail {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}

.ps-typing-detail__meta { color: var(--muted); margin-bottom: 4px; }
.ps-typing-detail__target { color: var(--text-soft); margin-bottom: 2px; }
.ps-typing-detail__typed { color: var(--ps-ink, #10233f); }
.ps-typing-detail__typed.is-miss { color: #c2410c; }

/* 京麦 1:1 接待台 */
.ps-tab--jm {
  margin: 0;
  min-height: 640px;
  padding: 0;
}

.ps-jm-loading {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1d4f91;
  font-size: 12px;
}

.jm-workbench {
  border: 1px solid #d7dbe0;
  border-radius: 6px;
  overflow: hidden;
  background: #eef0f3;
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.jm-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.jm-topbar__shop {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  font-size: 13px;
  color: #222;
}

.jm-topbar__status { color: #666; font-size: 12px; }
.jm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbb;
  display: inline-block;
}
.jm-dot--ok { background: #22c55e; }

.jm-topbar__metrics {
  display: flex;
  flex: 1;
  gap: 18px;
  flex-wrap: wrap;
}

.jm-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #888;
}
.jm-metric b {
  font-size: 16px;
  color: #222;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.jm-end-top { margin-left: auto; }

.jm-main {
  flex: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
  min-height: 0;
  background: #f3f4f6;
}

.jm-contacts {
  background: #f7f8fa;
  border-right: 1px solid #e3e6eb;
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

.jm-contacts__search { padding: 10px; }
.jm-contacts__input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e0e3e8;
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 12px;
  background: #fff;
  color: #999;
}

.jm-contacts__section {
  padding: 6px 12px 8px;
  font-size: 12px;
  color: #666;
  font-weight: 650;
}

.jm-contacts__item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  cursor: default;
  border-left: 3px solid transparent;
}

.jm-contacts__item.is-active {
  background: #e8f1ff;
  border-left-color: #2d8cf0;
}

.jm-contacts__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4f91;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.jm-contacts__meta { min-width: 0; flex: 1; }
.jm-contacts__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.jm-contacts__name {
  font-size: 13px;
  color: #222;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jm-contacts__time { font-size: 11px; color: #999; flex: 0 0 auto; }
.jm-contacts__preview {
  margin-top: 4px;
  font-size: 12px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jm-stage {
  display: flex;
  flex-direction: column;
  min-height: 580px;
  background: #fff;
  border-right: 1px solid #e3e6eb;
}

.jm-stage__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #eceff3;
  background: #fff;
}

.jm-stage__who strong { font-size: 14px; color: #222; }
.jm-stage__sub { display: block; margin-top: 2px; font-size: 11px; color: #999; }
.jm-stage__icons { color: #8a9199; letter-spacing: 4px; font-size: 13px; }

.jm-stage__msgs {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f5f6f8;
}

.jm-time {
  align-self: center;
  font-size: 12px;
  color: #a0a6ad;
  padding: 2px 0 6px;
}

.jm-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 78%;
}
.jm-msg.is-left { align-self: flex-start; }
.jm-msg.is-right {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.jm-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #666;
}
.jm-avatar--buyer { background: #fff; }
.jm-avatar--agent {
  background: #2d8cf0;
  border-color: #2d8cf0;
  color: #fff;
}

.jm-bubble {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: none;
}
.jm-bubble.is-agent {
  background: #e8f3ff;
  border-color: #cfe4ff;
}
.jm-bubble__text {
  font-size: 13px;
  line-height: 1.55;
  color: #222;
  white-space: pre-wrap;
  word-break: break-word;
}
.jm-bubble.is-agent .jm-bubble__text { color: #163a66; }
.jm-bubble__meta {
  margin-top: 4px;
  font-size: 11px;
  color: #9aa0a6;
  display: flex;
  gap: 8px;
}
.jm-unread { color: #2d8cf0; }
.jm-link { color: #2d8cf0; word-break: break-all; }

.jm-cardmsg {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 10px;
  min-width: 240px;
  max-width: 320px;
}
.jm-cardmsg__head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.jm-cardmsg__thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #888;
}
.jm-cardmsg__title {
  font-size: 13px;
  font-weight: 650;
  color: #222;
  line-height: 1.35;
  margin-bottom: 4px;
}
.jm-cardmsg__price {
  font-size: 16px;
  font-weight: 700;
  color: #e4393c;
}
.jm-cardmsg__shop { font-size: 11px; color: #999; margin-top: 2px; }
.jm-cardmsg__link {
  display: block;
  font-size: 12px;
  color: #2d8cf0;
  word-break: break-all;
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
}

.jm-typing {
  align-self: flex-start;
  font-size: 12px;
  color: #999;
  padding-left: 42px;
}

.jm-emoji-row {
  padding: 6px 12px 0;
  font-size: 16px;
  letter-spacing: 4px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  user-select: none;
}
.jm-toolbar {
  padding: 6px 12px;
  font-size: 14px;
  color: #6b7280;
  letter-spacing: 6px;
  background: #fff;
  user-select: none;
}

.jm-stage__foot {
  background: #fff;
  border-top: 1px solid #eceff3;
  padding: 0 12px 10px;
}

.jm-composer {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  outline: none;
  resize: none;
  min-height: 88px;
  padding: 8px 0;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}

.jm-sendrow {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.jm-hint { font-size: 11px; color: #b0b6bd; }
.jm-send {
  min-width: 86px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: #2d8cf0;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.jm-send:disabled { opacity: 0.55; cursor: not-allowed; }
.jm-send:hover:not(:disabled) { background: #1f7ae0; }

.jm-assist {
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  min-height: 580px;
  padding: 0 0 10px;
}

.jm-assist__tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.jm-assist__tab {
  border: 0;
  background: transparent;
  padding: 10px 10px;
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  cursor: pointer;
}
.jm-assist__tab.is-on {
  color: #2d8cf0;
  font-weight: 650;
  box-shadow: inset 0 -2px 0 #2d8cf0;
}

.jm-assist__block {
  margin: 10px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  padding: 12px;
}

.jm-assist__title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}
.jm-tag {
  font-size: 11px;
  color: #16a34a;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  border-radius: 3px;
  padding: 1px 6px;
}

.jm-assist__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 12px;
  margin-bottom: 10px;
}
.jm-assist__grid label {
  display: block;
  color: #999;
  margin-bottom: 2px;
}
.jm-assist__grid span { color: #333; }

.jm-assist__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.jm-chip {
  border: 1px solid #b7d4f8;
  background: #f5f9ff;
  color: #2d8cf0;
  border-radius: 4px;
  height: 30px;
  font-size: 12px;
  cursor: default;
}

.jm-assist__goods {
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
}
.jm-assist__goods-label { font-size: 11px; color: #999; margin-bottom: 6px; }
.jm-assist__goods-name {
  font-size: 13px;
  font-weight: 650;
  color: #222;
  line-height: 1.4;
  margin-bottom: 4px;
}
.jm-assist__goods-price {
  font-size: 18px;
  font-weight: 700;
  color: #e4393c;
  margin-bottom: 6px;
}
.jm-assist__goods-link {
  display: block;
  font-size: 12px;
  color: #2d8cf0;
  word-break: break-all;
}

.jm-assist__empty {
  margin: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  font-size: 12px;
}

.jm-assist__orders {
  margin: 0 10px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  padding: 10px;
  flex: 1;
}
.jm-assist__orders-tabs {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
}
.jm-assist__orders-tabs .is-on {
  color: #2d8cf0;
  font-weight: 650;
}
.jm-assist__orders-empty {
  min-height: 140px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #999;
  font-size: 12px;
}
.jm-mascot {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  font-size: 28px;
}

.jm-end-block {
  margin: 10px 10px 0;
  width: calc(100% - 20px);
  justify-content: center;
  min-height: 38px;
}

/* 远程打款：Excel 风格批量粘贴 */
.pay-entry-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.pay-batch-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.pay-batch-panel {
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
}
.pay-batch-panel__head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
}
.pay-batch-panel__title { margin: 0; font-size: 18px; }
.pay-batch-panel__sub { margin: 4px 0 0; color: #64748b; font-size: 13px; line-height: 1.45; }
.pay-batch-toolbar, .pay-batch-summary, .pay-batch-footer {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
}
.pay-batch-summary {
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}
.pay-grid {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: auto;
  max-height: min(52vh, 520px);
  outline: none;
}
.pay-grid:focus { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }
.pay-grid__head, .pay-grid__row {
  display: grid;
  grid-template-columns: 52px minmax(160px, 1.4fr) minmax(120px, 1fr) 110px minmax(180px, 1.3fr) 36px;
  gap: 0;
  align-items: stretch;
}
.pay-grid__head { position: sticky; top: 0; z-index: 1; background: #f1f5f9; }
.pay-grid__th, .pay-grid__td, .pay-grid__seq {
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  padding: 6px 8px;
  font-size: 13px;
  min-height: 34px;
}
.pay-grid__th { font-weight: 600; color: #334155; }
.pay-grid__seq { display: flex; align-items: center; justify-content: center; color: #64748b; }
.pay-grid__input {
  width: 100%; border: 0; outline: none; background: transparent;
  font: inherit; color: inherit; padding: 0;
}
.pay-grid__row.is-bad { background: #fff7f7; }
.pay-grid__row.is-ok { background: #f3faf6; }
.pay-grid__check--ok { color: #15803d; }
.pay-grid__check--warn { color: #b45309; }
.pay-grid__check--bad { color: #b91c1c; }
.pay-grid__check--muted { color: #94a3b8; }
.pay-grid__del {
  border: 0; background: transparent; color: #94a3b8; cursor: pointer; font-size: 18px;
}
.pay-grid__del:hover { color: #b91c1c; }

/* 审核 · 退货绑定发布表：独立 8 列，不复用打款 6 列网格 */
.ra-draft-wrap {
  overflow-x: auto;
  max-height: 360px;
  border: 1px solid var(--border-soft, #cbd5e1);
  border-radius: 8px;
  background: #fff;
}
.ra-draft-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}
.ra-draft-col-seq { width: 40px; }
.ra-draft-col-field { width: 108px; }
.ra-draft-col-addr { width: auto; }
.ra-draft-col-del { width: 52px; }
.ra-draft-table th,
.ra-draft-table td {
  box-sizing: border-box;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  padding: 6px 8px;
  font-size: 13px;
  vertical-align: middle;
  text-align: left;
  overflow: hidden;
}
.ra-draft-table th:last-child,
.ra-draft-table td:last-child {
  border-right: 0;
  text-align: center;
  overflow: visible;
}
.ra-draft-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}
.ra-draft-table__seq {
  text-align: center;
  color: #64748b;
}
.ra-draft-table__input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
}
.ra-draft-table__del {
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.ra-draft-table__del:hover { color: #b91c1c; }
.pay-batch-format {
  border: 1px solid #fcd34d; background: #fffbeb; border-radius: 8px; padding: 12px;
  display: grid; gap: 8px;
}
.pay-batch-format__title { font-weight: 600; color: #92400e; }
.pay-batch-format__hint { font-size: 12px; color: #a16207; }
.pay-batch-format__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pay-confirm-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  display: grid; place-items: center; padding: 16px;
}
.pay-confirm-panel {
  width: min(640px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  padding: 16px 18px 14px;
  display: grid;
  gap: 12px;
}
.pay-confirm-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pay-confirm-panel__head h3 { margin: 0; font-size: 18px; }
.pay-confirm-tip {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: #fff7ed; color: #9a3412; font-size: 13px; line-height: 1.45;
}
.pay-confirm-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.pay-confirm-kpis > div {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px;
  display: grid; gap: 2px;
}
.pay-confirm-kpis strong { font-size: 16px; color: #0f172a; }
.pay-confirm-kpis span { font-size: 12px; color: #64748b; }
.pay-confirm-detail {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px;
  max-height: 180px; overflow: auto; display: grid; gap: 4px;
  font-size: 12px; color: #334155;
}
.pay-confirm-detail__row { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pay-confirm-label { display: grid; gap: 6px; font-size: 13px; color: #334155; }
.pay-confirm-input {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 10px 12px; font-size: 14px;
}
.pay-confirm-input:focus {
  outline: none; border-color: #0284c7; box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.pay-confirm-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
@media (max-width: 720px) {
  .pay-confirm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .jm-main { grid-template-columns: 210px minmax(0, 1fr) 260px; }
}

@media (max-width: 980px) {
  .jm-main { grid-template-columns: minmax(0, 1fr) 260px; }
  .jm-contacts { display: none; }
}

@media (max-width: 720px) {
  .presale-shell { min-height: auto; border-radius: 12px; }
  .ps-hero { padding: 16px 14px 0; }
  .ps-hero__title { font-size: 28px; }
  .ps-hero__aside { align-items: flex-start; width: 100%; }
  .ps-hero__chips { justify-content: flex-start; }
  .ps-body { padding: 14px; }
  .ps-kpi-grid--4,
  .ps-kpi-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-nav__item { min-width: 96px; padding: 10px 12px 12px; }
  .ps-sop__layout { grid-template-columns: 1fr; }
  .ps-sop__nav {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ps-sop__article { max-height: none; padding: 16px; }
  .ps-train-grid { grid-template-columns: 1fr; }
  .jm-main { grid-template-columns: 1fr; }
  .jm-assist { border-top: 1px solid #e3e6eb; }
  .jm-topbar { flex-wrap: wrap; }
}

/* ============================================================
   深色主题壳层与共享组件（html[data-theme=dark]）
   Portal 弹层（#modal-root / #drawer-root / #toast-root）继承根令牌
   ============================================================ */

[data-theme="dark"] .sidebar {
  --sidebar-bg: #111823;
  --sidebar-bg-brand: #111823;
  --sidebar-bg-footer: #111823;
  --sidebar-bg-hover: #1b2532;
  --sidebar-bg-pressed: #1b2532;
  --sidebar-bg-expanded: rgba(255, 255, 255, 0.035);
  --sidebar-bg-active: rgba(78, 134, 235, 0.16);
  --sidebar-accent: #6ea0ff;
  --sidebar-accent-hover: #8ab3ff;
  --sidebar-text-primary: #f2f4f7;
  --sidebar-text-secondary: #aeb8c5;
  --sidebar-text-muted: #7f8a9a;
  --sidebar-text-active: #dde8ff;
  --sidebar-text-nav: #aeb8c5;
  --sidebar-text-footer: #aeb8c5;
  --sidebar-icon: #8e9aaa;
  --sidebar-icon-active: #6ea0ff;
  --sidebar-border: #2a3442;
  --sidebar-guide: #2a3442;
  --sidebar-focus: rgba(110, 160, 255, 0.28);
  --sidebar-danger: #f97066;
  --sidebar-danger-bg: rgba(249, 112, 102, 0.12);
}

[data-theme="dark"] .sidebar .nav-group { color: #7f8a9a; }
[data-theme="dark"] .sidebar-nav { scrollbar-color: var(--ui-scroll-thumb) transparent; }
[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb { background: var(--ui-scroll-thumb); }
[data-theme="dark"] .sidebar-nav:hover::-webkit-scrollbar-thumb { background: var(--ui-scroll-thumb-hover); }
[data-theme="dark"] .sidebar .nav-subitem .dot { background: #7f8a9a !important; }
[data-theme="dark"] .sidebar .nav-item.active:not(:has(+ .nav-sub))::before,
[data-theme="dark"] .sidebar .nav-subitem.active::before {
  background: #6ea0ff;
}
[data-theme="dark"] .sidebar-version { color: #7f8a9a; }

[data-theme="dark"] .kpi-green { background: rgba(67, 197, 138, 0.12); }
[data-theme="dark"] .kpi-red { background: rgba(249, 112, 102, 0.12); }
[data-theme="dark"] .kpi-dark::before { background: #8e9aaa; }

[data-theme="dark"] .dept-row.selected {
  background: rgba(78, 134, 235, 0.14);
  box-shadow: inset 3px 0 0 var(--brand);
}

[data-theme="dark"] .ps-panel,
[data-theme="dark"] .ps-kpi,
[data-theme="dark"] .ps-empty,
[data-theme="dark"] .ps-chart,
[data-theme="dark"] .presale-shell,
[data-theme="dark"] .biz-shell {
  background: var(--ui-surface);
  border-color: var(--ui-border);
  color: var(--ui-text-primary);
}

[data-theme="dark"] .ps-ovboard__head,
[data-theme="dark"] .ps-ovboard__part,
[data-theme="dark"] .ps-ovboard__part--brand,
[data-theme="dark"] .ps-ovboard__part--cyan {
  background: var(--ui-surface);
  border-color: var(--ui-border);
}
[data-theme="dark"] .ps-ovboard__analysis {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--ui-border);
}

[data-theme="dark"] .ps-nav,
[data-theme="dark"] .ps-body {
  background: var(--ui-canvas);
  color: var(--ui-text-primary);
}

[data-theme="dark"] .ps-hero__glow {
  background: radial-gradient(circle, rgba(75, 125, 230, 0.16), transparent 70%);
  opacity: 0.7;
}

/* 下拉 / 日期等原生控件在深色下可读 */
[data-theme="dark"] .app select option,
[data-theme="dark"] .modal select option,
[data-theme="dark"] .drawer select option {
  background: var(--ui-dropdown-surface);
  color: var(--ui-text-primary);
}

[data-theme="dark"] .changelog-select,
[data-theme="dark"] .biz-dash-select {
  background: var(--ui-control-bg);
  color: var(--ui-text-primary);
  border-color: var(--ui-control-border);
}

/* 滚动条：低对比，Hover 增强 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scroll-thumb) transparent;
}
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--ui-scroll-thumb);
  border-radius: 4px;
}
*:hover::-webkit-scrollbar-thumb { background: var(--ui-scroll-thumb-hover); }

/* 窄屏：隐藏主题文字，保留图标 + title/aria-label */
@media (max-width: 1280px), (max-resolution: 1.1dppx) and (max-width: 1440px) {
  .theme-switcher { width: 72px; }
  .theme-switcher__label { display: none; }
}
@media (max-width: 900px) {
  .theme-switcher { width: 64px; height: 30px; }
  .theme-switcher__btn { height: 24px; padding: 0 4px; }
  .theme-switcher__label { display: none; }
}

/* 禁用态：与正常态区分 */
.app input:disabled,
.app select:disabled,
.app textarea:disabled,
.modal input:disabled,
.drawer input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--ui-surface-subtle);
  color: var(--ui-text-muted);
}

/* 工单中心：部门横向二级菜单 */
.flow-dept-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
}
.flow-dept-nav .ps-nav__item {
  flex: 0 0 auto;
}

/* ---- 流转工单仪表盘 / 表格 ---- */
.flow-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.flow-dash-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow-bar-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 8px; }
.flow-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 36px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.flow-bar-label {
  color: var(--text-soft, var(--ui-text-muted));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--ui-surface-subtle, #eef2f7);
  overflow: hidden;
}
.flow-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #fb923c);
}
.flow-bar-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text, var(--ui-text));
}
.flow-table-wrap { overflow-x: auto; }
.flow-table-wrap table.data {
  min-width: 1440px;
  table-layout: fixed;
}
.flow-table-wrap table.data tbody tr { height: 64px; }
.flow-table-wrap table.data td {
  height: 64px;
  padding-top: 7px;
  padding-bottom: 7px;
  overflow: hidden;
}
.flow-ticket-clamp {
  display: -webkit-box;
  max-width: 100%;
  max-height: 2.7em;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.flow-ticket-order {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-ticket-subline {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.flow-ticket-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.flow-ticket-actions { gap: 6px; flex-wrap: nowrap; }
.flow-view-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 10px;
  padding: 8px 10px;
  border: 1px solid var(--ui-border-soft, #edf0f4);
  border-radius: 8px;
  background: var(--ui-surface-subtle, #f7f9fc);
  font-size: 12px;
}
.flow-view-notice__title {
  flex: 0 0 auto;
  font-weight: 650;
  color: var(--ui-text-primary, #101828);
}

/* 钉钉人员建议 */
.flow-person { position: relative; }
.flow-person__hint { font-size: 11px; margin-top: 4px; }
.flow-person__hint.ok { color: var(--ok, #15803d); }
.flow-suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% - 18px);
  z-index: 40;
  background: var(--ui-surface, #fff);
  border: 1px solid var(--ui-border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  max-height: 220px;
  overflow: auto;
  padding: 4px;
}
.flow-suggest__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.flow-suggest__item:hover { background: var(--ui-surface-subtle, #f3f4f6); }
.flow-suggest__name { font-weight: 400; font-size: 13px; }
.flow-person .flow-suggest__name { font-weight: 400; }
.flow-suggest__meta { font-size: 11px; color: var(--ui-text-muted, #6b7280); }
.flow-suggest__empty { padding: 10px; font-size: 12px; color: var(--ui-text-muted, #6b7280); }

/* 粘贴截图 */
.flow-paste-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px dashed var(--ui-border, #d1d5db);
  border-radius: 8px;
  padding: 10px;
  background: var(--ui-surface-subtle, #fafafa);
}
.flow-paste-zone:focus-within {
  border-color: var(--brand, #f59e0b);
  background: #fff;
}
.flow-paste-zone__tip { font-size: 11px; }
.flow-img-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-img-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--ui-border, #e5e7eb);
}
.flow-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flow-img-thumb__x {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.flow-event-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.flow-event-image-button {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
}
.flow-event-image-button:focus-visible {
  outline: 2px solid #356ae6;
  outline-offset: 2px;
}
.flow-event-images img {
  display: block;
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #e5e7eb);
}
.flow-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 16px;
  background: rgba(8, 15, 28, 0.88);
  backdrop-filter: blur(3px);
  animation: fade 0.15s ease;
}
.flow-image-lightbox__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  color: #fff;
}
.flow-image-lightbox__counter {
  min-width: 72px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  text-align: center;
}
.flow-image-lightbox__tool,
.flow-image-lightbox__close,
.flow-image-lightbox__nav {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}
.flow-image-lightbox__tool:hover,
.flow-image-lightbox__close:hover,
.flow-image-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.24);
}
.flow-image-lightbox__tool,
.flow-image-lightbox__close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 20px;
}
.flow-image-lightbox__close {
  position: absolute;
  top: 16px;
  right: 18px;
  border-radius: 999px;
  font-size: 24px;
}
.flow-image-lightbox__zoom-label {
  min-width: 48px;
  color: #fff;
  font-size: 13px;
  text-align: center;
}
.flow-image-lightbox__stage {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-out;
}
.flow-image-lightbox__image {
  display: block;
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  transition: transform 0.12s ease;
}
.flow-image-lightbox__image.is-zoomed { cursor: grab; }
.flow-image-lightbox__image.is-dragging {
  cursor: grabbing;
  transition: none;
}
.flow-image-lightbox__nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 56px;
  border-radius: 10px;
  font-size: 36px;
  transform: translateY(-50%);
}
.flow-image-lightbox__nav--prev { left: 8px; }
.flow-image-lightbox__nav--next { right: 8px; }
.flow-image-lightbox__hint {
  padding-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 640px) {
  .flow-image-lightbox { padding: 8px; }
  .flow-image-lightbox__image {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 112px);
  }
  .flow-image-lightbox__nav { width: 38px; height: 48px; }
  .flow-image-lightbox__close { top: 10px; right: 10px; }
}

@media (max-width: 900px) {
  .flow-dash-grid--2 { grid-template-columns: 1fr; }
  .flow-bar-row { grid-template-columns: 72px 1fr 28px; }
}

/* ---------- 售中小额打款：截图凭证站内弹窗 ---------- */
.pay-evidence-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.55);
  animation: fade 0.15s ease;
}
.pay-evidence-panel {
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--ui-modal-surface, #fff);
  color: var(--ui-text-primary, #111);
  border: 1px solid var(--ui-border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.pay-evidence-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.pay-evidence-panel__head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.pay-evidence-body {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
  min-height: 220px;
}
.pay-evidence-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pay-evidence-counter {
  flex: 1;
  text-align: center;
  font-size: 13px;
}
.pay-evidence-imgwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: 58vh;
  background: #0f172a0d;
  border: 1px solid var(--ui-border, #e5e7eb);
  border-radius: 8px;
  overflow: auto;
  padding: 8px;
}
.pay-evidence-img {
  display: block;
  max-width: 100%;
  max-height: 54vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
}
.pay-evidence-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  font-size: 12px;
  color: var(--text-soft, #475569);
}
.pay-evidence-error {
  padding: 16px;
  text-align: center;
  font-size: 14px;
}
.pay-evidence-note {
  margin: 0;
  padding: 10px 16px 14px;
  font-size: 12px;
  color: var(--muted, #64748b);
  border-top: 1px solid var(--border, #e5e7eb);
}
.pay-evidence-open {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .pay-evidence-meta { grid-template-columns: 1fr; }
  .pay-evidence-imgwrap { min-height: 200px; max-height: 50vh; }
}

/* ---------- 售中 · 小额打款页签（.pay-remote 作用域，不影响其他页签） ---------- */
.pay-remote {
  gap: 10px;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pay-remote__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0;
  width: 100%;
  min-width: 0;
}
.pay-remote__title { margin: 0; font-size: 18px; font-weight: 700; }
.pay-remote__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pay-kpi-card {
  border: 1px solid var(--ui-border, #e5e7eb);
  background: var(--ui-modal-surface, #fff);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.pay-kpi-card--static { cursor: default; }
.pay-kpi-card.is-active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
  background: #eff6ff;
}
.pay-kpi-card__label { font-size: 12px; color: var(--muted, #64748b); }
.pay-kpi-card__value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.pay-kpi-card--success .pay-kpi-card__value { color: #0e8c60; }
.pay-kpi-card--danger .pay-kpi-card__value { color: #c93c31; }
.pay-kpi-card--warn .pay-kpi-card__value { color: #b45309; }
.pay-kpi-card--info .pay-kpi-card__value { color: #2563eb; }
.pay-entry-compact {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--ui-border, #e5e7eb);
  border-radius: 10px;
  background: var(--ui-modal-surface, #fff);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pay-entry-compact__create,
.pay-entry-compact__batch {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.pay-entry-compact__create .ps-input { width: 132px; }
.pay-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--ui-border, #e5e7eb);
  border-radius: 10px;
  background: #f8fafc;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pay-filter-bar .ps-input,
.pay-filter-bar select { min-height: 32px; }
.pay-filter-q { min-width: 200px; flex: 1 1 220px; }
.pay-task-panel {
  margin: 0;
  padding: 8px 10px 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pay-sticky-head {
  overflow-x: auto;
}
.pay-sticky-head .table-wrap {
  overflow: visible;
}
.pay-sticky-head table.data,
.pay-task-table table.data {
  min-width: 1280px;
  width: 100%;
  table-layout: fixed;
}
.pay-task-table table.data th:nth-child(7),
.pay-task-table table.data td:nth-child(7) {
  /* 失败原因：给足可读宽度，其余列单行省略 */
  width: 260px;
}
.pay-sticky-head table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--ui-modal-surface, #fff);
}
.pay-sticky-head table.data th,
.pay-sticky-head table.data td {
  padding: 11px 14px;
}
.pay-sticky-head table.data td {
  overflow: hidden;
}
.pay-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.pay-status-badge--success { background: #e4f7ef; color: #0e8c60; }
.pay-status-badge--danger { background: #fdeceb; color: #c93c31; }
.pay-status-badge--warn,
.pay-status-badge--uncertain { background: #fef3c7; color: #b45309; }
.pay-status-badge--uncertain { background: #fef2f2; color: #b91c1c; font-weight: 700; }
.pay-status-badge--info { background: #eff6ff; color: #1d4ed8; }
.pay-status-badge--muted { background: #f1f5f9; color: #64748b; }
.pay-fail-cell {
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}
.pay-cell-clip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pay-copy {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  text-align: left; color: inherit;
}
.pay-copy--clip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pay-copy:hover { text-decoration: underline; }
.pay-sticky-head .ps-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pay-pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 8px;
}
.pay-workers-fold {
  border: 1px solid var(--ui-border, #e5e7eb);
  border-radius: 10px;
  background: var(--ui-modal-surface, #fff);
  overflow: hidden;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pay-workers-fold__head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px;
  border: 0; background: transparent; cursor: pointer; text-align: left; color: inherit;
}
.pay-workers-fold__summary { font-size: 12px; color: var(--muted, #64748b); margin-top: 2px; }
.pay-workers-fold__body { padding: 0 12px 12px; border-top: 1px solid var(--ui-border, #e5e7eb); }
.pay-workers-fold__actions { padding: 8px 0; }
.pay-worker-offline { color: #c93c31; font-weight: 600; }
.pay-detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px;
  font-size: 13px;
}
.pay-tech-bar { display: flex; gap: 8px; margin: 14px 0 8px; }
.pay-tech-pre {
  margin: 0; padding: 10px; border-radius: 8px;
  background: #0f172a0d; font-size: 12px; white-space: pre-wrap; word-break: break-all;
}
@media (max-width: 1100px) {
  .pay-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .pay-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-detail-grid { grid-template-columns: 1fr; }
}

.ps-nav--insale {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ps-nav__primary,
.ps-nav__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.ps-nav__secondary.is-empty {
  display: none;
}
.ps-nav__item--sub {
  font-size: 13px;
}
.ps-fault-card {
  padding: 18px 8px 8px;
}
.ps-embed-host {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.ps-embed-status {
  flex: 0 0 auto;
  padding: 0 4px 8px;
}
.ps-embed-frame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
body.insale-embed-fill,
body.insale-embed-fill .app {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
body.insale-embed-fill .main,
body.insale-embed-fill #content,
body.insale-embed-fill .presale-shell,
body.insale-embed-fill .ps-body,
body.insale-embed-fill .ps-embed-host,
body.insale-embed-fill .ps-embed-frame {
  min-width: 0;
  min-height: 0;
}
body.insale-embed-fill .main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
body.insale-embed-fill #content {
  flex: 1 1 auto;
  display: block;
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}
body.insale-embed-fill .footer {
  display: none;
}
body.insale-embed-fill .presale-shell {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}
body.insale-embed-fill .ps-hero--insale {
  padding: 12px 16px 0;
}
body.insale-embed-fill .ps-hero--insale .ps-hero__title {
  font-size: 22px;
}
body.insale-embed-fill .ps-hero--insale .ps-hero__row {
  margin-bottom: 8px;
}
body.insale-embed-fill .ps-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
}
body.insale-embed-fill .ps-embed-host,
body.insale-embed-fill .ps-embed-frame {
  flex: 1 1 auto;
  height: 100%;
}
@media (max-width: 720px) {
  body.insale-embed-fill .ps-nav__primary,
  body.insale-embed-fill .ps-nav__secondary {
    flex-wrap: wrap;
  }
}

/* 京巡盾控制台：企业级旗舰排版 */
.xun-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.xun-panel {
  overflow: hidden;
}
.xun-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}
.xun-panel__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #152033);
}
.xun-panel__desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-compose {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}
.xun-compose__row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(160px, 1.1fr) 120px 120px;
  gap: 12px 14px;
  align-items: end;
}
.xun-compose__filters {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) auto;
  gap: 12px 14px;
  align-items: end;
}
.xun-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.xun-field > span {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted, #667085);
}
.xun-field .ps-input,
.xun-field select.ps-input {
  width: 100%;
  height: 36px;
}
.xun-field--keyword .ps-input {
  font-size: 14px;
  font-weight: 600;
}
.xun-field--concurrent {
  max-width: 140px;
  margin-top: 8px;
}
.xun-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 2px;
}
.xun-scopes .ps-field {
  margin: 0;
}
.xun-store-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--ps-line, #e6ebf2);
  background: #f8fafc;
}
.xun-store-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
}
.xun-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 12px;
}
.xun-chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.xun-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  padding: 12px 16px 16px;
}
.xun-store-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line, #d8dee8);
  border-radius: 10px;
  background: #fff;
}
.xun-store-card.is-disabled { opacity: 0.55; }
.xun-store-card__name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text, #152033);
}
.xun-store-card__id {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-store-more {
  display: flex;
  justify-content: center;
  padding: 0 16px 16px;
}
.xun-empty {
  padding: 28px 16px 32px;
  text-align: center;
}
.xun-empty__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #152033);
}
.xun-empty__desc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-task-table {
  padding: 4px 8px 12px;
}
.xun-task-table .pager {
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding: 10px 0 4px;
}
.xun-task-head,
.xun-task-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(140px, 1.1fr) minmax(88px, 0.8fr) 96px minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
}
.xun-task-table.is-plain .xun-task-head,
.xun-task-table.is-plain .xun-task-row {
  grid-template-columns: minmax(160px, 1.4fr) minmax(140px, 1.1fr) minmax(88px, 0.8fr) 96px minmax(140px, 1fr);
}
.xun-task-head {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted, #667085);
  border-bottom: 1px solid var(--ps-line, #e6ebf2);
}
.xun-task-row {
  border-bottom: 1px solid #eef2f7;
}
.xun-task-row:last-child { border-bottom: 0; }
.xun-task-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}
.xun-task-name {
  font-size: 13px;
  font-weight: 650;
  color: #1d4ed8;
}
.xun-task-link:hover .xun-task-name {
  text-decoration: underline;
}
.xun-task-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.xun-device-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
}
.xun-device-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.xun-device-name {
  font-size: 13px;
  font-weight: 700;
}
.xun-device-meta {
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-device-detail {
  padding: 0 16px 14px;
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-fold {
  appearance: none;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.xun-drill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--muted, #667085);
}
.xun-drill-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 16px 16px;
}
.xun-product-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.xun-product-group__head {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #152033);
}
.xun-product-table {
  padding: 0 16px 16px;
}
.xun-product-head,
.xun-product-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(160px, 1.2fr) 88px;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
}
.xun-product-head {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted, #667085);
  border-bottom: 1px solid var(--ps-line, #e6ebf2);
}
.xun-product-row {
  border-bottom: 1px solid #eef2f7;
}
.xun-product-row:last-child { border-bottom: 0; }
.xun-finding-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--line, #d8dee8);
  border-radius: 10px;
  padding: 10px;
}
.xun-finding-card__body {
  flex: 1;
  min-width: 0;
}
.xun-finding-card__head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.xun-finding-gallery {
  width: 168px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.xun-finding-gallery.is-wide {
  width: 420px;
  max-width: 100%;
}
.xun-finding-gallery__img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  background: #f3f5f8;
  display: block;
}
.xun-finding-gallery.is-wide .xun-finding-gallery__img {
  height: 218px;
  object-fit: contain;
}
.xun-finding-gallery__empty {
  min-height: 120px;
  border-radius: 8px;
  background: #f3f5f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #889;
}
.xun-finding-gallery__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.xun-finding-gallery__count {
  min-width: 36px;
  text-align: center;
  color: var(--muted, #667085);
  font-size: 12px;
}
.xun-finding-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.xun-finding-gallery__thumb {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #d6dbe3;
  border-radius: 6px;
  background: #fff;
  color: #445;
  font-size: 12px;
  cursor: pointer;
}
.xun-finding-gallery__thumb.is-on {
  border-color: #2f7ef0;
  background: #eef5ff;
  color: #1d4f9a;
}
.xun-param-rows {
  margin-top: 8px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}
.xun-param-rows__title {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted, #667085);
  margin-bottom: 6px;
}
.xun-param-rows__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}
.xun-param-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
}
.xun-param-row.is-hit {
  background: #fff1f2;
  border-radius: 4px;
  padding: 2px 4px;
}
.xun-param-row__name {
  flex: 0 0 72px;
  color: var(--muted, #667085);
}
.xun-param-row__value {
  min-width: 0;
  color: var(--text, #152033);
  word-break: break-all;
}
.xun-finding-lightbox {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.xun-finding-lightbox__media {
  flex: 1.4;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.xun-finding-lightbox__img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f5f8;
}
.xun-finding-lightbox__side {
  flex: 1;
  min-width: 220px;
}
@media (max-width: 960px) {
  .xun-compose__row,
  .xun-compose__filters,
  .xun-task-head,
  .xun-task-row,
  .xun-product-head,
  .xun-product-row {
    grid-template-columns: 1fr 1fr;
  }
  .xun-task-head,
  .xun-product-head { display: none; }
}

[data-theme="dark"] .xun-store-bar { background: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .xun-store-card,
[data-theme="dark"] .xun-chip {
  background: var(--ui-surface);
  border-color: var(--ui-border);
  color: var(--ui-text-primary);
}
[data-theme="dark"] .xun-chip { background: rgba(75, 125, 230, 0.16); color: #93c5fd; }
