/* ========== 企业 ERP 风格 · 深顶栏 + 浅侧栏 + 白主区 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --canvas: #f0f2f5;
  --erp-topnav: #2c3e50;
  --erp-topnav-hover: #34495e;
  --erp-topnav-text: #ecf0f1;

  --background: 0 0% 100%;
  --foreground: 220 9% 22%;
  --muted-foreground: 220 9% 46%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 20%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 20%;
  /* QCOS 设计系统主色 #2563EB */
  --qcos-blue: #2563eb;
  --qcos-blue-hover: #1d4ed8;
  --qcos-count: #9ca3af;
  --primary: 221 83% 53%;
  --primary-foreground: 0 0% 100%;
  --primary-soft: 221 83% 97%;
  --secondary: 210 14% 96%;
  --secondary-foreground: 0 0% 22%;
  --muted: 210 14% 96%;
  --muted-foreground: 220 9% 46%;
  --accent: 210 30% 94%;
  --accent-foreground: 221 83% 40%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 86%;
  --input: 0 0% 86%;
  --ring: 221 83% 53%;
  --radius: 6px;

  --border-strong: 0 0% 78%;

  --success: 142 71% 36%;
  --warning: 32 95% 40%;
  --danger: 0 72% 51%;

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --text-title: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-placeholder: #9ca3af;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --shadow-sm: 0 1px 0 rgb(0 0 0 / 0.06);
  --shadow-md: 0 1px 3px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 2px 8px rgb(0 0 0 / 0.1);

  --r: var(--radius);
  --r-sm: 4px;

  --sidebar-bg: 210 14% 98%;
  --sidebar-border: 210 14% 90%;
  --sidebar-muted: 0 0% 45%;
  --sidebar-section-title: 0 0% 28%;
  --sidebar-hover: 210 14% 94%;
  --sidebar-shadow: none;
}


html {
  color-scheme: light;
}

body {
  font-family: var(--sans);
  background-color: #fff;
  color: var(--text-body);
  margin: 0;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'rlig' 1, 'calt' 1;
}

body.layout-erp {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.auth-locked {
  background:
    radial-gradient(circle at 8% 18%, rgb(67 139 255 / 0.18), transparent 22rem),
    radial-gradient(circle at 80% 12%, rgb(255 255 255 / 0.95), transparent 28rem),
    linear-gradient(135deg, #eaf3ff 0%, #f5f9ff 48%, #edf5ff 100%);
}

body.auth-booting #login-modal,
body.auth-booting #login-modal.hidden {
  display: none !important;
}

body.auth-booting .erp-body {
  visibility: visible;
}

body.auth-locked .erp-body {
  display: none !important;
}

body.auth-locked #login-modal.hidden,
body.auth-locked #login-modal {
  display: flex !important;
}

body.auth-locked #login-modal {
  background:
    linear-gradient(115deg, rgb(255 255 255 / 0.15), transparent 42%),
    radial-gradient(ellipse at 22% 78%, rgb(43 123 255 / 0.22), transparent 24rem),
    radial-gradient(ellipse at 18% 58%, rgb(255 255 255 / 0.88), transparent 18rem),
    linear-gradient(135deg, rgb(236 245 255 / 0.96), rgb(248 251 255 / 0.96));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 36px;
  overflow: hidden;
}

body.auth-locked #login-modal .modal-content {
  max-width: 1120px;
  min-height: 640px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

body.auth-locked #login-modal-close {
  display: none;
}

.login-portal {
  display: grid;
  grid-template-columns: minmax(470px, 1fr) 460px;
  align-items: center;
  gap: 86px;
  width: min(1230px, calc(100vw - 72px));
}

.login-brand-panel {
  position: relative;
  min-height: 560px;
  padding: 72px 0 44px 40px;
  color: #0f2f68;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  left: -110px;
  top: -110px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.8);
  box-shadow: 0 0 70px rgb(52 139 255 / 0.14);
}

.login-brand-logo {
  font-size: clamp(72px, 9vw, 116px);
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: 0.035em;
  color: #1677ff;
  text-shadow: 0 4px 0 #7cc1ff, 0 12px 22px rgb(22 119 255 / 0.28);
  transform: skewX(-7deg);
}

.login-brand-panel h1 {
  margin: 22px 0;
  color: #102f66;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0.23em;
}

.login-brand-line {
  margin-left: 4px;
  color: #2c4c7e;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.login-orbit {
  position: absolute;
  left: 18px;
  bottom: 28px;
  width: 560px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 56%, rgb(255 255 255 / 0.9), transparent 56px),
    radial-gradient(ellipse at center, rgb(31 128 255 / 0.16), transparent 68%);
  filter: drop-shadow(0 24px 44px rgb(56 116 194 / 0.12));
}

.login-orbit::before,
.login-orbit::after {
  content: '';
  position: absolute;
  inset: 30px 18px;
  border: 1px solid rgb(40 130 255 / 0.18);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.login-orbit::after {
  inset: 54px 72px;
  transform: rotate(10deg);
  border-color: rgb(255 255 255 / 0.9);
}

.login-orbit-core {
  position: absolute;
  left: 245px;
  top: 86px;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, rgb(255 255 255 / 0.85), rgb(181 218 255 / 0.62));
  color: rgb(28 119 255 / 0.72);
  font-size: 42px;
  font-weight: 900;
  box-shadow: 0 18px 40px rgb(43 123 255 / 0.18);
  backdrop-filter: blur(12px);
}

.login-feature {
  position: absolute;
  min-width: 72px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.42);
  border: 1px solid rgb(255 255 255 / 0.72);
  color: #315b99;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 14px 34px rgb(62 122 207 / 0.13);
  backdrop-filter: blur(10px);
}

.login-feature-a { left: 34px; top: 98px; }
.login-feature-b { left: 140px; top: 42px; }
.login-feature-c { right: 120px; top: 38px; }
.login-feature-d { right: 20px; top: 92px; }

.login-card-panel {
  position: relative;
  padding: 48px 44px 32px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.76), rgb(255 255 255 / 0.58));
  border: 1px solid rgb(255 255 255 / 0.82);
  box-shadow: 0 28px 80px rgb(45 89 156 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-card-panel::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  border: 1px solid rgb(255 255 255 / 0.36);
  pointer-events: none;
}

.login-card-copy h2 {
  margin: 0 0 8px;
  color: #18366d;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.login-card-copy p {
  margin: 0 0 28px;
  color: #526b91;
  font-size: 14px;
}

.login-form-modern {
  gap: 12px;
}

.login-form-modern > label {
  color: #203f72;
  font-size: 12px;
  font-weight: 700;
}

.login-input-wrap {
  position: relative;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.login-input-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid rgb(186 206 236 / 0.75);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.82);
  color: #172b4d;
  font-size: 14px;
  line-height: 54px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-wrap input:focus {
  border-color: #2788ff;
  box-shadow: 0 0 0 3px rgb(39 136 255 / 0.13);
}

.login-input-password {
  gap: 8px;
}

.login-input-password input {
  flex: 1;
  min-width: 0;
}

.login-password-toggle {
  position: static;
  flex: 0 0 42px;
  width: 42px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgb(186 206 236 / 0.75);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.82);
  color: #7085a7;
  cursor: pointer;
}

.login-password-toggle:hover {
  background: rgb(22 119 255 / 0.08);
  color: #1677ff;
}

.login-password-toggle svg {
  width: 16px;
  height: 16px;
}

.login-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 2px;
  color: #526b91;
  font-size: 12px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-remember input {
  accent-color: #1989ff;
}

.login-forgot {
  color: #7187a8;
}

.login-security-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0 18px;
  padding: 14px;
  border-radius: 8px;
  background: rgb(225 239 255 / 0.72);
  color: #4d668e;
  font-size: 12px;
  line-height: 1.55;
}

.login-security-tip span {
  color: #1778df;
  font-weight: 900;
  width: 20px;
  height: 20px;
  display: inline-flex;
  flex-shrink: 0;
}

.login-security-tip svg {
  width: 20px;
  height: 20px;
}

.login-submit {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 78px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(90deg, #1e9bff, #1768ef);
  box-shadow: 0 14px 26px rgb(24 116 239 / 0.33);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.24em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgb(24 116 239 / 0.38);
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.login-submit-arrow {
  font-size: 24px;
  letter-spacing: 0;
}

.login-copyright {
  margin: 54px 0 0;
  color: #8090aa;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 900px) {
  body.auth-locked #login-modal {
    padding: 20px;
  }

  .login-portal {
    grid-template-columns: 1fr;
    gap: 18px;
    width: min(440px, calc(100vw - 40px));
  }

  .login-brand-panel {
    min-height: auto;
    padding: 18px 0;
    text-align: center;
  }

  .login-brand-logo {
    font-size: 58px;
  }

  .login-brand-panel h1 {
    font-size: 26px;
  }

  .login-orbit {
    display: none;
  }
}

.erp-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
  height: 100vh;
}

/* ---- 全宽深色顶栏 ---- */
.erp-topnav {
  flex-shrink: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--erp-topnav);
  color: var(--erp-topnav-text);
  border-bottom: 1px solid rgb(0 0 0 / 0.15);
  z-index: 50;
}

.erp-topnav-tools-only {
  justify-content: flex-end;
}

.erp-topnav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.erp-topnav-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* 副标题「智能品质中枢」：略抬字重、字距与胶囊底，避免细灰字糊在顶栏上 */
.erp-topnav-sub {
  margin-left: 2px;
  padding: 4px 11px 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.2;
  color: rgb(255 255 255 / 0.96);
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 999px;
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.18);
  -webkit-font-smoothing: antialiased;
}

.erp-topnav-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.erp-topnav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgb(255 255 255 / 0.88);
  cursor: pointer;
}

.erp-topnav-icon:hover {
  background: var(--erp-topnav-hover);
  color: #fff;
}

.erp-caliper-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.11);
  color: rgb(255 255 255 / 0.92);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.erp-caliper-status:hover,
.erp-caliper-status--on {
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}

.erp-caliper-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffccc7;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.12);
}

.erp-caliper-dot--on {
  background: #52c41a;
}

.erp-topnav-tools {
  flex-shrink: 1;
  min-width: 0;
  gap: 6px;
}

.erp-topnav-tools .topbar-icon-btn {
  width: 30px;
  height: 28px;
  border-color: rgb(255 255 255 / 0.24);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.11);
  color: rgb(255 255 255 / 0.92);
}

.erp-topnav-tools .topbar-icon-btn:hover {
  border-color: rgb(255 255 255 / 0.36);
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}

.erp-topnav-tools .global-scan {
  width: min(260px, 24vw);
  height: 28px;
  padding: 5px 10px;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.96);
  color: #1f2937;
  font-size: 12px;
}

.erp-topnav-tools #btn-global-scan {
  min-height: 28px;
  padding: 4px 10px;
  border-color: rgb(255 255 255 / 0.25);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.18);
  color: #fff;
}

.erp-topnav-tools .notify-panel {
  top: 36px;
}

.erp-version {
  font-size: 11px;
  font-weight: 500;
  color: rgb(255 255 255 / 0.65);
  padding: 0 10px 0 6px;
  font-variant-numeric: tabular-nums;
}

.erp-topnav-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  margin-left: 4px;
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(0 0 0 / 0.12);
  font-size: 12px;
  max-width: 200px;
}

.erp-user-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.erp-user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden { display: none !important; }

/* ---- 侧栏（浅灰 · 企业导航） ---- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  background: #f8f9fa;
  border-right: 1px solid #ddd;
  box-shadow: var(--sidebar-shadow);
  position: relative;
  z-index: 2;
}

.sidebar-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 10px;
  margin: 0;
  border-bottom: 1px solid #ddd;
  background: #fff;
}

.sidebar-search-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  margin: 0;
  background: #f8f9fa;
}

.sidebar-search-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 0;
  background: #fff;
  border: 1px solid #ddd;
  transition: border-color 0.15s;
}

.sidebar-search-label:focus-within {
  border-color: hsl(var(--primary));
  outline: 1px solid hsl(var(--primary) / 0.35);
  outline-offset: 0;
}

.sidebar-search-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: hsl(var(--muted-foreground));
}

.sidebar-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  color: hsl(var(--foreground));
  outline: none;
}

.sidebar-search-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.sidebar-search-kbd {
  flex-shrink: 0;
  padding: 4px 6px;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #777;
  background: #fff;
  border: 1px solid #ddd;
}

.sidebar-menu-prefs-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 24px);
  margin: 0 12px 10px;
  padding: 7px 10px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  background: #fff;
  color: hsl(var(--muted-foreground));
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sidebar-menu-prefs-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sidebar-menu-prefs-btn:hover {
  border-color: hsl(var(--primary) / 0.45);
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.04);
}

.nav-menu-prefs-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
}

.nav-menu-prefs-hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.nav-menu-prefs-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-menu-prefs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-menu-prefs-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
}

.nav-menu-prefs-search:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.12);
}

.nav-menu-prefs-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.nav-menu-prefs-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  overflow: hidden;
  background: hsl(var(--card));
}

.nav-menu-prefs-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.22);
  overflow: auto;
}

.nav-menu-prefs-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: hsl(var(--foreground));
  font-family: var(--sans);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.nav-menu-prefs-group-btn:hover {
  background: hsl(var(--muted) / 0.55);
}

.nav-menu-prefs-group-btn.is-active {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-weight: 600;
}

.nav-menu-prefs-group-btn-meta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.nav-menu-prefs-group-btn.is-active .nav-menu-prefs-group-btn-meta {
  color: hsl(var(--primary));
}

.nav-menu-prefs-pages {
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-menu-prefs-section.is-pane-hidden,
.nav-menu-prefs-section.is-filtered-out {
  display: none;
}

.nav-menu-prefs-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed hsl(var(--border));
}

.nav-menu-prefs-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.nav-menu-prefs-section-meta {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.nav-menu-prefs-section-pages {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-menu-prefs-page {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  margin-left: 4px;
  border-left: 2px solid hsl(var(--border));
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  cursor: pointer;
}

.nav-menu-prefs-page:hover:not(.is-disabled) {
  background: hsl(var(--muted) / 0.35);
  border-left-color: hsl(var(--primary) / 0.45);
}

.nav-menu-prefs-page.is-filtered-out {
  display: none;
}

.nav-menu-prefs-page.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nav-menu-prefs-page input {
  margin-top: 3px;
  flex-shrink: 0;
}

.nav-menu-prefs-page-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-menu-prefs-page-main strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.nav-menu-prefs-page-main small {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  line-height: 1.35;
}

.nav-menu-prefs-badge {
  margin-left: auto;
  font-size: 11px;
  font-style: normal;
  color: hsl(var(--muted-foreground));
}

.nav-menu-prefs-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid hsl(var(--border));
}

@media (max-width: 640px) {
  .nav-menu-prefs-split {
    grid-template-columns: 1fr;
  }

  .nav-menu-prefs-groups {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid hsl(var(--border));
  }

  .nav-menu-prefs-group-btn {
    width: auto;
    flex: 1 1 calc(50% - 4px);
  }
}

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

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: var(--erp-topnav);
  border: 1px solid rgb(0 0 0 / 0.12);
}

.brand-letter {
  font-size: 20px;
  font-weight: 800;
  color: hsl(0 0% 100%);
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0;
  color: #333;
  line-height: 1.2;
}

.brand-sub {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: none;
  color: #5c6570;
  -webkit-font-smoothing: antialiased;
}

.sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 8px 10px 12px;
  scrollbar-color: #ccc transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: hsl(var(--sidebar-border));
  border-radius: 8px;
}

.nav-section {
  margin-bottom: 8px;
  padding: 4px 0 6px;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid #e8e8e8;
  background: transparent;
}

.nav-section:last-of-type {
  margin-bottom: 0;
  border-bottom: none;
}

.nav-section-admin {
  margin-top: 0;
  border-bottom: 1px solid #e8e8e8;
  background: transparent;
}

/* 侧栏手风琴：主模块点击展开/收起子菜单 */
.nav-section-accordion {
  margin-bottom: 0;
}

.nav-section-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  margin: 0;
  padding: 10px 8px 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: background 0.15s, color 0.15s;
}

.nav-section-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
  border-radius: 6px;
  border: 1px solid hsl(var(--primary) / 0.12);
}

.nav-section-toggle:hover .nav-section-toggle-icon {
  background: hsl(var(--primary) / 0.14);
  border-color: hsl(var(--primary) / 0.22);
}

.nav-section-toggle-svg {
  width: 20px;
  height: 20px;
  display: block;
  opacity: 0.95;
}

.nav-section-toggle:hover .nav-section-toggle-svg {
  opacity: 1;
}

.nav-section-toggle:hover {
  color: hsl(var(--primary));
  background: rgb(0 0 0 / 0.04);
}

.nav-section-toggle:focus-visible {
  outline: 2px solid hsl(var(--primary) / 0.45);
  outline-offset: -2px;
}

.nav-section-toggle-text {
  min-width: 0;
  text-align: left;
}

.nav-section-toggle-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #777;
  transition: transform 0.2s var(--ease-out);
  transform-origin: 50% 35%;
}

.nav-section-accordion.is-open .nav-section-toggle-chevron {
  transform: rotate(180deg);
}

.nav-section-accordion:not(.is-open) .nav-section-body {
  display: none;
}

.nav-section-body {
  padding: 0 0 6px 2px;
}

.sidebar-nav > .nav-section-accordion:first-child .nav-section-toggle {
  padding-top: 10px;
}

.sidebar-nav .nav-section-body .nav-item {
  padding-left: 12px;
}

.sidebar-nav .nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 8px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 400;
  color: #333;
  text-decoration: none;
  border-radius: 0;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.nav-item-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.9;
  stroke-width: 2;
}

.nav-item-text {
  min-width: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav .nav-item:hover {
  color: #111;
  background: #eceff1;
  border-color: transparent;
}

.sidebar-nav .nav-item:hover .nav-item-icon {
  opacity: 1;
  color: hsl(var(--primary));
}

.sidebar-nav .nav-item:focus-visible {
  outline: 2px solid hsl(var(--primary) / 0.5);
  outline-offset: -2px;
}

.sidebar-nav .nav-item.active {
  color: hsl(var(--primary));
  background: #e3eef8;
  font-weight: 600;
  border-color: transparent;
  box-shadow: none;
}

.sidebar-nav .nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0;
  background: hsl(var(--primary));
}

.sidebar-nav .nav-item.active .nav-item-icon {
  opacity: 1;
  color: hsl(var(--primary));
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 12px 12px 14px;
  margin-top: auto;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #ddd;
  background: #fff;
}

.sidebar-footer-toggle {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 4px;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
}

.sidebar-footer-toggle:hover {
  color: #2563eb;
  background: #f9fafb;
}

.sidebar-footer.is-collapsed .sidebar-profile,
.sidebar-footer.is-collapsed .sidebar-auth-panel {
  display: none;
}

.sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.sidebar-tools-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sidebar-notify-wrap {
  position: relative;
}

.sidebar-notify-wrap .notify-panel {
  top: auto;
  right: auto;
  bottom: 0;
  left: calc(100% + 8px);
  z-index: 200;
}

.sidebar-tool-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar-tool-btn:hover {
  background: #f0f5ff;
  border-color: #c7d2fe;
  color: #1677ff;
}

.sidebar-caliper-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  box-sizing: border-box;
}

.sidebar-caliper-btn:hover {
  background: #f0f5ff;
  border-color: #c7d2fe;
  color: #2563eb;
}

.sidebar-tools-scan {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.sidebar-global-scan {
  flex: none;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  box-sizing: border-box;
}

.sidebar-tools-scan .sidebar-scan-btn,
.sidebar-tools-scan #btn-global-scan {
  width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.sidebar-version {
  display: none;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 0;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.sidebar-profile-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--erp-topnav);
  border: 1px solid rgb(0 0 0 / 0.1);
}

.sidebar-profile-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-profile-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-account {
  font-size: 10px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-auth-panel {
  border: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  padding: 7px 8px;
  display: grid;
  gap: 5px;
}

.sidebar-auth-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}

.sidebar-auth-actions .btn {
  min-width: 62px;
  padding: 5px 10px;
  font-size: 12px;
}

/* ---- 主区（白底 · 页头 + 工具条） ---- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: #fff;
  padding: 0;
}

.app-page-head {
  flex-shrink: 0;
  padding: 16px 20px 0;
  background: #fff;
}

.app-page-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-page-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  flex-shrink: 0;
}

.app-page-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  color: #333;
}

.app-page-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 10px 0 0;
}

.app-page-desc {
  margin: 8px 0 0;
  padding-bottom: 12px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #777;
  line-height: 1.5;
}

.app-page-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 20px 12px;
  flex-shrink: 0;
  background: #fafafa;
  border-bottom: 1px solid #ddd;
}

.app-page-toolbar-spacer {
  flex: 1;
  min-width: 8px;
}

.topbar-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.topbar-date-label {
  font-size: 12px;
  color: #555;
  font-weight: 500;
}

.topbar-date-input {
  padding: 5px 8px;
  border-radius: 0;
  border: 1px solid #ddd;
  font-family: var(--sans);
  font-size: 12px;
  color: #333;
  background: #fff;
}

.topbar-date-sep {
  color: #777;
  font-size: 12px;
}

.topbar-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border-radius: 0;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.topbar-icon-btn:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

.topbar-user-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--primary));
  background: hsl(var(--primary-soft));
  border: 1px solid hsl(var(--primary) / 0.18);
}

.topbar-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.notify-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: hsl(var(--danger));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
}

.notify-panel {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 90;
  width: 280px;
  padding: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
}

.notify-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: hsl(var(--foreground));
  font-size: 13px;
}

.notify-panel-head span {
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}

.notify-panel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notify-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  cursor: pointer;
}

.notify-item strong {
  color: hsl(var(--primary));
}

.user-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}

#current-user,
.global-scan {
  font-family: var(--sans);
  padding: 6px 10px;
  border-radius: 0;
  font-size: 13px;
  color: #333;
  background-color: #fff;
  border: 1px solid #ddd;
  outline: none;
  transition: border-color 0.15s;
}

#current-user {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
}

.form-row input,
.form-row select,
.filter-row input,
.filter-row select,
.iqc-toolbar-card input,
.iqc-toolbar-card select,
.form-grid input,
.form-grid select,
.spc-select select {
  font-family: var(--sans);
  padding: 6px 10px;
  border-radius: 0;
  font-size: 13px;
  color: #333;
  background-color: #fff;
  border: 1px solid #ddd;
  outline: none;
  transition: border-color 0.15s;
}

#current-user:focus,
.global-scan:focus {
  border-color: hsl(var(--primary));
  outline: 1px solid hsl(var(--primary) / 0.35);
  outline-offset: 0;
}

.form-row input:focus,
.form-row select:focus,
.filter-row input:focus,
.filter-row select:focus,
.iqc-toolbar-card input:focus,
.iqc-toolbar-card select:focus,
.form-grid input:focus,
.form-grid select:focus,
.spc-select select:focus {
  border-color: hsl(var(--primary));
  outline: 1px solid hsl(var(--primary) / 0.35);
  outline-offset: 0;
}

.global-scan { width: min(280px, 38vw); }

.sidebar .global-scan,
.sidebar-global-scan {
  width: 100% !important;
  max-width: 100%;
}
.global-scan::placeholder { color: var(--text-placeholder); opacity: 1; }

.app-content {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
  background: #fff;
}

.app-content .page { min-height: 100%; }

/* ---- 按钮 ---- */
.btn {
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active { opacity: 0.92; }

.btn-primary {
  color: #fff;
  background: hsl(var(--primary));
  border-color: hsl(221 83% 42%);
  box-shadow: none;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-success {
  color: hsl(0 0% 98%);
  background: hsl(var(--success));
}

.btn-success:hover {
  filter: brightness(1.08);
}

.btn-warn {
  color: #fff;
  background: #fa8c16;
  border-color: #d46b08;
}

.btn-warn:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
}

.btn-ghost:hover {
  background: #f5f5f5;
  color: #111;
  border-color: #bbb;
}

.btn-danger {
  color: #fff;
  background: hsl(var(--danger));
  border-color: hsl(var(--danger));
}

.btn-danger:hover {
  filter: brightness(1.04);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-close {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 0;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: background 0.2s, color 0.2s;
}

.btn-close:hover {
  background: rgba(251, 113, 133, 0.15);
  color: hsl(var(--danger));
}

.btn-delete {
  color: hsl(var(--danger));
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
}

.btn-icon {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s;
}

.btn-icon:hover {
  opacity: 1;
  background: rgba(251, 113, 133, 0.12);
}

/* ---- 卡片 / 表格 ---- */
.card {
  background: #fff;
  color: #333;
  border-radius: 0;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  box-shadow: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px 16px;
  align-items: center;
  max-width: 560px;
}

.form-grid.small { grid-template-columns: 1fr 1fr; max-width: 720px; }

.form-grid label {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  text-transform: none;
  letter-spacing: 0;
}

.req { color: hsl(var(--danger)); }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.task-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: -4px 0 14px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--primary-soft));
}

.task-bulk-check,
.task-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.task-bulk-count {
  color: hsl(var(--primary));
  font-size: 12px;
  font-weight: 700;
}

.task-bulk-bar input[type="text"] {
  min-width: 180px;
  padding: 6px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: #fff;
}

.task-bulk-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 650;
}

.task-bulk-date input {
  padding: 6px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: #fff;
}

.task-bulk-sep {
  width: 1px;
  height: 22px;
  background: hsl(var(--border));
}

.page-actions { margin-bottom: 12px; }

.hint {
  color: #666;
  font-size: 13px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 0;
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
}

.text-danger { color: hsl(var(--danger)); font-weight: 700; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #ddd;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
}

.data-table th {
  background: #f0f2f5;
  font-weight: 600;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: #333;
}

.data-table td {
  font-size: 13px;
  color: hsl(var(--foreground));
}

.data-table tr:hover td {
  background: hsl(var(--primary) / 0.04);
}

.data-table tr.row-selected td {
  background: hsl(var(--primary) / 0.10);
}

.data-table.compact th,
.data-table.compact td { padding: 8px 12px; font-size: 12px; }

.col-actions,
.table-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

.table-actions .btn-sm { margin-left: 4px; }

.cell-center {
  text-align: center;
  vertical-align: middle;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: none;
}

.table-wrap .data-table {
  margin: 0;
  border-radius: 0;
  border: none;
}

.ai-publish-result-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* ========== AI 审核工作台 ========== */
#page-ai-review {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.ai-review-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-review-hero,
.ai-review-filter,
.ai-review-kpi,
.ai-review-toolbar,
.ai-batch-table-wrap,
.ai-draft-table-wrap,
.ai-draft-detail-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.ai-review-hero,
.ai-review-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.ai-review-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.ai-review-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.ai-review-filter {
  padding: 12px 14px;
}

.ai-review-date-filter,
.ai-review-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-review-date-filter span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ai-review-filter input,
.ai-review-toolbar input,
.ai-review-toolbar select {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.ai-review-search input {
  width: min(360px, 38vw);
  border-radius: 999px;
}

.ai-review-search select {
  min-width: 150px;
}

.ai-review-filter input:focus,
.ai-review-toolbar input:focus,
.ai-review-toolbar select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.ai-review-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.ai-review-kpi {
  position: relative;
  min-height: 110px;
  padding: 18px 16px 15px 60px;
  text-align: left;
  cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.ai-review-kpi:hover {
  transform: translateY(-1px);
  border-color: rgb(22 119 255 / 0.28);
  box-shadow: 0 14px 30px rgb(15 23 42 / 0.08);
}

.ai-review-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--ai-kpi-bg, #eef6ff);
}

.ai-review-kpi::after {
  content: '';
  position: absolute;
  left: 28px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ai-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.ai-review-kpi span,
.ai-review-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.ai-review-kpi strong {
  display: block;
  margin: 10px 0 6px;
  color: #172033;
  font-size: 27px;
  line-height: 1;
}

.ai-kpi-blue { --ai-kpi-color: #1677ff; --ai-kpi-bg: #e8f3ff; }
.ai-kpi-orange { --ai-kpi-color: #f59e0b; --ai-kpi-bg: #fff7e6; }
.ai-kpi-cyan { --ai-kpi-color: #0ea5e9; --ai-kpi-bg: #e6f7ff; }
.ai-kpi-green { --ai-kpi-color: #16a34a; --ai-kpi-bg: #ecfdf3; }
.ai-kpi-red { --ai-kpi-color: #ef4444; --ai-kpi-bg: #fff1f2; }
.ai-kpi-purple { --ai-kpi-color: #8b5cf6; --ai-kpi-bg: #f5f3ff; }

.ai-item-stats {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgb(22 119 255 / 0.14);
  background: rgb(232 243 255 / 0.55);
  color: #334155;
}

.ai-balloon-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgb(245 158 11 / 0.45);
  background: rgb(255 251 235 / 0.95);
  color: #92400e;
  font-size: 12px;
  line-height: 1.55;
}

.ai-qwen-review {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgb(124 58 237 / 0.22);
  border-radius: 12px;
  background: rgb(245 243 255 / 0.72);
}

.ai-qwen-review-head,
.ai-qwen-review-group-head,
.ai-qwen-review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-qwen-review-groups {
  display: grid;
  gap: 8px;
}

.ai-qwen-review-group {
  padding: 10px;
  border: 1px solid rgb(148 163 184 / 0.25);
  border-left: 4px solid #8b5cf6;
  border-radius: 9px;
  background: #fff;
}

.ai-qwen-review-group.is-duplicate {
  border-left-color: #ef4444;
}

.ai-qwen-review-group.is-keep_all {
  border-left-color: #16a34a;
}

.ai-qwen-review-group.is-uncertain {
  border-left-color: #f59e0b;
}

.ai-qwen-review-group p {
  margin: 6px 0;
}

.ai-balloon-cell {
  width: 56px;
  text-align: center;
  vertical-align: middle;
}

.ai-balloon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.ai-balloon-badge.is-balloon {
  border: 1px solid rgb(22 119 255 / 0.28);
  background: rgb(232 243 255 / 0.95);
  color: #1d4ed8;
}

.ai-balloon-badge.is-auto {
  border: 1px dashed rgb(100 116 139 / 0.35);
  background: rgb(248 250 252 / 0.95);
  color: #64748b;
  font-size: 11px;
}

.ai-item-row-balloon td {
  background: rgb(248 251 255 / 0.72);
}

.ai-item-row-auto td {
  background: #fff;
}

.ai-review-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.ai-review-toolbar input {
  min-width: 220px;
}

.ai-batch-table-wrap,
.ai-draft-table-wrap {
  overflow: hidden;
  padding: 0;
}

.ai-batch-table,
.ai-draft-table,
.ai-draft-detail-card .data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.ai-batch-table thead th,
.ai-draft-table thead th,
.ai-draft-detail-card .data-table thead th {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.ai-batch-table tbody td,
.ai-draft-table tbody td,
.ai-draft-detail-card .data-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
}

.ai-batch-table tbody tr:hover td,
.ai-draft-table tbody tr:hover td,
.ai-draft-detail-card .data-table tbody tr:hover td {
  background: #f8fbff;
}

.ai-batch-table .row-selected td,
.ai-draft-table .row-selected td {
  background: #eef6ff !important;
}

.ai-draft-detail-card {
  padding: 16px;
}

.ai-draft-detail-card > .iqc-form-section-title {
  margin-bottom: 12px;
  color: #172033;
  font-size: 15px;
}

.ai-draft-detail-card .form-row {
  margin-bottom: 10px;
}

.ai-publish-options {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr);
  gap: 10px 14px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #f8fbff;
}

.ai-publish-options label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.ai-publish-options .hint,
.ai-conflict-hint,
.ai-product-match {
  grid-column: 1 / -1;
}

.ai-conflict-hint {
  padding: 9px 10px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
}

.ai-product-match {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.ai-customer-validation {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
}

.ai-customer-validation-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-match-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 800;
}

.ai-match-candidates {
  display: grid;
  gap: 8px;
}

.ai-match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.ai-draft-detail-card input,
.ai-draft-detail-card select {
  min-height: 36px;
  border-radius: 8px;
  border-color: #dfe7f1;
}

.ai-draft-detail-card .table-wrap {
  border-color: #e6edf5;
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 1280px) {
  .ai-review-kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .ai-review-hero,
  .ai-review-filter,
  .ai-review-date-filter,
  .ai-review-search {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-review-search input {
    width: 100%;
  }

  .ai-review-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.instruments-page {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ins-sidebar {
  width: 200px;
  flex-shrink: 0;
  padding: 14px 12px;
}

.ins-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 10px;
}

#ins-cat-all {
  width: 100%;
  margin-bottom: 8px;
}

.ins-cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
}

.ins-cat-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ins-cat-btn:hover {
  background: hsl(var(--muted));
}

.ins-cat-btn-active {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-weight: 600;
}

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

.ins-reminder-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.ins-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* 子页统一壳：物料编辑 / MSA 明细等 */
.qcos-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.qcos-breadcrumb-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--qcos-blue, #2563eb);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.qcos-breadcrumb-link:hover {
  color: var(--qcos-blue-hover, #1d4ed8);
  text-decoration: underline;
}

.qcos-subpage-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
  margin: 0 0 14px;
  padding: 16px 20px;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #fff, #f7fbff),
    linear-gradient(90deg, rgb(37 99 235 / 0.06), transparent);
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
}

.qcos-subpage-hero::after {
  content: '';
  position: absolute;
  right: 24px;
  bottom: -42px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgb(37 99 235 / 0.055);
  pointer-events: none;
}

.qcos-subpage-hero > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.qcos-subpage-hero h2 {
  margin: 4px 0 0;
  color: #0f172a;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.qcos-subpage-hero h2 + p,
.qcos-subpage-hero .msa-detail-badge {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.msa-detail-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msa-detail-hero {
  margin-bottom: 0;
}

.msa-detail-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.msa-detail-badge {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

@media (max-width: 900px) {
  .qcos-subpage-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
  }

  .msa-detail-actions,
  .ped-title-panel {
    align-items: flex-start;
    width: 100%;
  }

  .msa-detail-actions,
  .ped-title-actions {
    justify-content: flex-start;
  }
}

.msa-meta-grid textarea {
  grid-column: 1 / -1;
  min-height: 56px;
  resize: vertical;
  font-family: var(--sans);
}

.msa-grid-outer {
  overflow-x: auto;
  padding: 12px 14px !important;
}

.msa-matrix .msa-op-row td {
  background: hsl(var(--muted));
  font-size: 13px;
}

.msa-matrix th {
  font-size: 11px;
}

.msa-cell {
  width: 72px;
  max-width: 96px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: var(--r-sm);
  border: 1px solid hsl(var(--input));
}

/* 测量系统分析 · MSA Analysis Command Center */
#page-msa {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-msa .msa-command-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  align-items: stretch;
  box-sizing: border-box;
}

#page-msa .msa-hero,
#page-msa .msa-filter-console,
#page-msa .msa-registry-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-msa .msa-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-msa .msa-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-msa .msa-hero > * {
  position: relative;
  z-index: 1;
}

#page-msa .msa-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-msa .msa-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-msa .msa-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-msa .msa-hero p:not(.msa-hero-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-msa .msa-hero-tags,
#page-msa .msa-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-msa .msa-hero-tags {
  margin-top: 14px;
}

#page-msa .msa-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-msa .msa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

#page-msa .msa-kpi.kpi-filter-btn {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border-radius: 24px;
}

button.msa-kpi.kpi-filter-btn {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#page-msa .msa-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--msa-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-msa .msa-kpi-blue { --msa-kpi-color: #1677ff; }
#page-msa .msa-kpi-orange { --msa-kpi-color: #f59e0b; }
#page-msa .msa-kpi-green { --msa-kpi-color: #22c55e; }
#page-msa .msa-kpi-red { --msa-kpi-color: #ef4444; }

#page-msa .msa-kpi.kpi-filter-btn:not(.is-active) {
  border: 1px solid var(--ai-line);
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-msa .msa-kpi.kpi-filter-btn.is-active {
  border-color: var(--kpi-accent, #1677ff) !important;
  border-width: 2px !important;
  border-bottom-width: 4px !important;
  border-bottom-color: var(--kpi-accent, #1677ff) !important;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--kpi-accent, #1677ff) 22%, transparent),
    0 18px 38px color-mix(in srgb, var(--kpi-accent, #1677ff) 18%, transparent) !important;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--kpi-accent, #1677ff) 16%, transparent), transparent 8rem),
    linear-gradient(180deg, #fff, color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 90%, #fff)) !important;
  transform: translateY(-2px);
  z-index: 1;
}

#page-msa .msa-kpi.kpi-filter-btn.is-active::before {
  box-shadow:
    0 0 0 4px rgb(255 255 255 / 0.88),
    0 0 16px color-mix(in srgb, var(--msa-kpi-color, var(--kpi-accent, #1677ff)) 58%, transparent) !important;
  background: var(--msa-kpi-color, var(--kpi-accent, #1677ff)) !important;
}

#page-msa .msa-kpi strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-msa .msa-filter-console {
  align-items: center;
  padding: 18px !important;
}

#page-msa .msa-filter-console::before {
  content: none !important;
  display: none !important;
}

#page-msa .msa-console-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-msa .msa-console-head strong,
#page-msa .msa-registry-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-msa .msa-console-head p,
#page-msa .msa-registry-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-msa .msa-filter-console input {
  height: 38px;
  border-radius: 999px;
}

#page-msa .msa-registry-panel {
  overflow: hidden;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

#page-msa .msa-registry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf3fb;
}

#page-msa .msa-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#page-msa .msa-table-wrap .data-table thead th {
  background: #f6faff;
  color: #5b6b84;
  font-size: 12px;
  font-weight: 900;
}

#page-msa .msa-table-wrap .data-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-msa .msa-table-wrap .data-table tbody tr:hover td {
  background: #f8fbff;
}

#page-msa .msa-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-msa .msa-empty-cell strong,
#page-msa .msa-empty-cell span {
  display: block;
}

#page-msa .msa-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-msa .msa-hero,
  #page-msa .msa-registry-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #page-msa .msa-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .instruments-page {
    flex-direction: column;
  }

  .ins-sidebar {
    width: 100%;
    max-height: none;
  }

  .ins-cat-list {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }

  .ins-cat-btn {
    width: auto;
  }
}

/* 测量仪器台账 · Instrument Ledger Command Center */
#page-instruments {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-instruments .instruments-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  align-items: stretch;
  box-sizing: border-box;
}

#page-instruments .ins-hero,
#page-instruments .ins-sidebar,
#page-instruments .ins-caliper-card,
#page-instruments .ins-filter-console,
#page-instruments #ins-form,
#page-instruments .ins-registry-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-instruments .ins-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-instruments .ins-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-instruments .ins-hero > * {
  position: relative;
  z-index: 1;
}

#page-instruments .ins-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-instruments .ins-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-instruments .ins-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-instruments .ins-hero p:not(.ins-hero-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-instruments .ins-hero-tags,
#page-instruments .ins-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-instruments .ins-hero-tags {
  margin-top: 14px;
}

#page-instruments .ins-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-instruments .ins-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

#page-instruments .ins-kpi {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-instruments .ins-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--ins-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-instruments .ins-kpi-green { --ins-kpi-color: #22c55e; }
#page-instruments .ins-kpi-orange { --ins-kpi-color: #f59e0b; }
#page-instruments .ins-kpi-red { --ins-kpi-color: #ef4444; }

#page-instruments .ins-kpi span,
#page-instruments .ins-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-instruments .ins-kpi strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-instruments .ins-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

#page-instruments .ins-sidebar {
  width: auto;
  padding: 16px !important;
}

#page-instruments .ins-sidebar-title,
#page-instruments .ins-console-head strong,
#page-instruments .ins-registry-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-instruments .ins-cat-btn {
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--ai-sub);
  font-weight: 750;
}

#page-instruments .ins-cat-btn:hover {
  background: #eef6ff;
  color: var(--ai-blue);
}

#page-instruments .ins-cat-btn-active {
  border-color: rgb(47 125 255 / 0.14);
  background: #eaf4ff;
  color: var(--ai-blue);
  box-shadow: 0 8px 18px rgb(47 125 255 / 0.08);
}

#page-instruments .ins-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

#page-instruments .ins-caliper-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px !important;
}

#page-instruments .ins-caliper-card strong {
  color: var(--ai-text);
  font-weight: 950;
}

#page-instruments .ins-caliper-card p {
  margin: 5px 0 0;
  color: var(--ai-sub);
}

#page-instruments .ins-caliper-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

#page-instruments .ins-filter-console {
  align-items: center;
  padding: 18px !important;
}

#page-instruments .ins-filter-console::before {
  content: none !important;
  display: none !important;
}

#page-instruments .ins-console-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-instruments .ins-console-head p,
#page-instruments .ins-registry-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-instruments #ins-q {
  min-width: min(340px, 100%);
  height: 38px;
  border-radius: 999px;
}

#page-instruments #ins-form {
  padding: 18px !important;
}

#page-instruments .ins-registry-panel {
  overflow: hidden;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

#page-instruments .ins-registry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf3fb;
}

#page-instruments .ins-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  overflow-x: auto;
}

#page-instruments .ins-table-wrap .data-table thead th {
  background: #f6faff;
  color: #5b6b84;
  font-size: 12px;
  font-weight: 900;
}

#page-instruments .ins-table-wrap .data-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-instruments .ins-table-wrap .data-table tbody tr:hover td {
  background: #f8fbff;
}

#page-instruments .ins-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-instruments .ins-empty-cell strong,
#page-instruments .ins-empty-cell span {
  display: block;
}

#page-instruments .ins-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-instruments .ins-hero,
  #page-instruments .ins-caliper-card,
  #page-instruments .ins-registry-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #page-instruments .ins-kpi-grid,
  #page-instruments .ins-workspace {
    grid-template-columns: 1fr;
  }
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.card-head {
  font-weight: 700;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  padding: 10px 14px;
  margin: -14px -16px 12px;
  border-radius: 0;
}

.card-head-green {
  background: rgba(34, 197, 94, 0.08);
  color: hsl(var(--success));
  border-bottom: 1px solid rgba(34, 197, 94, 0.22);
}

.card-head-warn {
  background: rgba(245, 158, 11, 0.08);
  color: hsl(var(--warning));
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
}

/* ---- KPI ---- */
.kpi-row {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.kpi {
  flex: 1;
  min-width: 140px;
  padding: 16px 18px;
  text-align: center;
  border-radius: 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: none;
  transition: border-color 0.2s;
}

.kpi:hover {
  border-color: #bbb;
}

.kpi-val {
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-green .kpi-val {
  color: hsl(var(--success));
}

.kpi-blue .kpi-val {
  color: hsl(var(--foreground));
}

.kpi-orange .kpi-val {
  color: hsl(var(--warning));
}

/* ---- 任务卡片 ---- */
.task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.task-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0;
  padding: 14px 16px;
  transition: border-color 0.2s;
}

.task-card:hover {
  border-color: #bbb;
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.task-card-top .badge {
  margin-left: auto;
}

.task-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
  color: hsl(var(--foreground));
}

.task-card-meta {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 5px;
}

.task-card-meta span {
  color: hsl(var(--muted-foreground));
  margin-right: 8px;
  font-weight: 600;
}

.task-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-ok {
  background: rgba(34, 197, 94, 0.12);
  color: hsl(var(--success));
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge-danger {
  background: rgba(251, 113, 133, 0.12);
  color: hsl(var(--danger));
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.badge-muted {
  background: hsl(var(--muted) / 0.35);
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.badge-warn {
  background: rgba(245, 158, 11, 0.14);
  color: hsl(32 95% 38%);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* ---- 物料档案列表布局 ---- */
.prod-archive-layout {
  display: grid;
  grid-template-columns: minmax(248px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .prod-archive-layout {
    grid-template-columns: 1fr;
  }
}

/* 物料档案 · 主从布局（宽屏可选：列表 + 编辑分屏；默认关闭，见 editProduct） */
body.prod-master-detail-open .app-content {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

body.prod-master-detail-open #page-products,
body.prod-master-detail-open #page-product-edit {
  display: block !important;
  flex: 1 1 50%;
  min-width: 0;
  max-height: calc(100vh - 148px);
  overflow: auto;
  margin: 0;
}

body.prod-master-detail-open #page-product-edit {
  flex: 1 1 54%;
  border-left: 1px solid var(--pro-border-soft, #e6edf5);
}

body.prod-master-detail-open #page-products .prod-hero,
body.prod-master-detail-open #page-products .prod-kpi-grid,
body.prod-master-detail-open #page-products .prod-scan-strip,
body.prod-master-detail-open #page-products .prod-archive-help,
body.prod-master-detail-open #page-products .prod-action-grid,
body.prod-master-detail-open #page-products .prod-archive-toolbar,
body.prod-master-detail-open #page-products .prod-archive-aside {
  display: none;
}

body.prod-master-detail-open #page-products .prod-archive-layout {
  grid-template-columns: minmax(200px, 220px) minmax(0, 1fr);
  gap: 12px;
}

body.prod-master-detail-open #page-products .prod-page-shell {
  gap: 10px;
  padding-bottom: 8px;
}

body.prod-master-detail-open #page-product-edit .ped-titlebar {
  position: sticky;
  top: 0;
  z-index: 2;
}

body.prod-master-detail-open #prod-tbody tr.prod-row--active {
  background: #eaf4ff;
  box-shadow: inset 3px 0 0 var(--qcos-blue, #2563eb);
}

@media (max-width: 1100px) {
  body.prod-master-detail-open #page-products {
    flex: 1 1 42%;
  }
}

@media (max-width: 900px) {
  body.prod-master-detail-open .app-content {
    flex-direction: column;
  }

  body.prod-master-detail-open #page-products {
    display: none !important;
  }

  body.prod-master-detail-open #page-product-edit {
    flex: 1 1 auto;
    max-height: none;
    border-left: none;
  }
}

.prod-archive-aside {
  padding: 14px;
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 12px;
  box-shadow: 0 1px 0 hsl(var(--border));
}

.prod-aside-section {
  border-radius: 12px;
  padding: 12px 12px 14px;
  background: hsl(var(--muted) / 0.22);
  border: 1px solid hsl(var(--border) / 0.85);
}

.prod-aside-head {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.prod-aside-head-copy {
  min-width: 0;
  flex: 1;
}

.prod-aside-toggle {
  flex-shrink: 0;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.prod-aside-toggle:hover {
  border-color: hsl(var(--primary) / 0.45);
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.06);
}

.prod-aside-section.is-collapsed .prod-aside-body {
  display: none;
}

.prod-aside-section.is-collapsed .prod-aside-sub {
  display: none;
}

.prod-aside-section.is-collapsed .prod-aside-head {
  margin-bottom: 0;
}

.prod-aside-section.is-collapsed {
  padding-bottom: 12px;
}

.prod-aside-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: hsl(var(--foreground));
}

.prod-aside-sub {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
}

/* 阶段：胶囊芯片，自动换行 */
.prod-stage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prod-stage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.prod-stage-chip:hover {
  border-color: hsl(var(--primary) / 0.45);
  background: hsl(var(--muted) / 0.35);
}

.prod-stage-chip--active {
  font-weight: 600;
  border-color: hsl(var(--primary) / 0.55);
  background: hsl(var(--primary) / 0.12);
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.12);
}

.prod-aside-search {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 8px;
  font-size: 12px;
  padding: 8px 10px;
}

/* 类型：左侧指示条 + 轻量列表 */
.prod-type-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 2px 0 2px 2px;
  margin: 0 -2px 0 0;
}

.prod-type-nav::-webkit-scrollbar {
  width: 6px;
}
.prod-type-nav::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.25);
  border-radius: 6px;
}

.prod-type-row {
  text-align: left;
  width: 100%;
  padding: 9px 10px 9px 11px;
  border-radius: 8px;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  color: hsl(var(--foreground));
  transition: background 0.12s ease, border-color 0.12s ease;
}

.prod-type-row:hover {
  background: hsl(var(--muted) / 0.38);
}

.prod-type-row--active {
  font-weight: 600;
  background: hsl(var(--primary) / 0.08);
  border-left-color: hsl(var(--primary));
}

.prod-type-row .mono {
  font-size: 11px;
  opacity: 0.85;
}

.prod-stage-chip:focus-visible,
.prod-type-row:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.prod-archive-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.prod-archive-toolbar {
  padding: 12px 14px;
}

.prod-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.prod-toolbar-filters {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid hsl(var(--border));
}

.prod-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: hsl(var(--muted) / 0.28);
  border: 1px dashed hsl(var(--border));
  font-size: 12px;
}

.prod-active-filters-label {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
}

.prod-active-filter-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.input-grow {
  flex: 1;
  min-width: 160px;
}

.prod-quick-add {
  align-items: center;
}

.prod-quick-label {
  flex-shrink: 0;
}

.prod-archive-table-wrap {
  overflow-x: auto;
  padding: 0;
}

/* 物料档案：桌面表格 / 窄屏卡片（避免桌面端重复渲染） */
.prod-mobile-cards {
  display: none;
}

.prod-mobile-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.prod-mobile-card.is-disabled {
  opacity: 0.65;
}

.prod-mobile-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.prod-mobile-card-head strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}

.prod-mobile-card-head small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #475569;
}

.prod-mobile-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.prod-mobile-card-grid span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.prod-mobile-card-grid b {
  font-size: 12px;
  font-weight: 600;
  color: #172033;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-mobile-card-grid small {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.prod-mobile-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.prod-mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 960px) {
  .prod-archive-table {
    display: none;
  }

  .prod-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px 16px;
  }
}

.prod-archive-table {
  min-width: 1100px;
}

.prod-archive-table .col-cb {
  width: 36px;
}

.ped-mat-tabs {
  margin-bottom: 0;
}

.ped-mat-pane {
  margin-top: 0;
  border-radius: 0 0 8px 8px;
}

.ped-mat-pane.hidden {
  display: none;
}

.ped-pane-hint {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin: 0 0 12px;
}

.ped-section-title {
  font-weight: 700;
  font-size: 0.8125rem;
  margin: 12px 0 8px;
  color: hsl(var(--foreground));
}

.ped-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 16px;
}

.ped-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
}

.prod-archive-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.prod-page-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 物料档案 · 现代档案台 */
#page-products {
  background:
    radial-gradient(circle at 10% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.prod-page-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prod-hero,
.prod-kpi,
.prod-scan-strip,
.prod-archive-aside,
.prod-archive-toolbar,
.prod-quick-add,
#page-products .filter-row,
.prod-archive-table-wrap,
.prod-archive-pagination {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.prod-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(232 243 255 / 0.88)),
    linear-gradient(90deg, rgb(22 119 255 / 0.08), transparent);
}

.prod-hero::after {
  content: '';
  position: absolute;
  right: -46px;
  top: -76px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgb(22 119 255 / 0.1);
}

.prod-hero-main,
.prod-hero-panel,
.prod-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.prod-hero-panel {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.prod-hero-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prod-eyebrow,
.prod-section-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.prod-hero-flow,
.ped-title-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgb(37 99 235 / 0.14);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.74);
  color: #476173;
  font-size: 12px;
  font-weight: 800;
}

.prod-hero-flow i,
.ped-title-flow i {
  width: 18px;
  height: 1px;
  background: rgb(37 99 235 / 0.32);
}

.prod-hero-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #e8f3ff, #ffffff);
  color: #1677ff;
  font-size: 22px;
  box-shadow: inset 0 0 0 1px rgb(22 119 255 / 0.16);
}

.prod-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.prod-hero p {
  margin: 5px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.prod-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.prod-kpi {
  position: relative;
  min-height: 96px;
  padding: 16px 18px 14px 64px;
  text-align: left;
}

.prod-kpi-button,
.kpi-filter-btn {
  width: 100%;
  border: 2px solid transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  border-radius: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  --kpi-accent: #1677ff;
  --kpi-accent-bg: #eef6ff;
}

.prod-kpi.kpi-filter-btn,
.prod-kpi-button { --kpi-accent: var(--prod-kpi-color, #1677ff); --kpi-accent-bg: var(--prod-kpi-bg, #eef6ff); }
.tq-kpi.kpi-filter-btn { --kpi-accent: var(--tq-kpi-color, #1677ff); --kpi-accent-bg: var(--tq-kpi-bg, #eef6ff); }
.mdmp-kpi.kpi-filter-btn { --kpi-accent: var(--mdmp-kpi-color, #1677ff); --kpi-accent-bg: var(--mdmp-kpi-bg, #eef6ff); }
.ai-review-kpi.kpi-filter-btn { --kpi-accent: var(--ai-kpi-color, #1677ff); --kpi-accent-bg: var(--ai-kpi-bg, #eef6ff); }
.of-kpi.kpi-filter-btn { --kpi-accent: var(--of-kpi-color, #1677ff); --kpi-accent-bg: var(--of-kpi-bg, #eef6ff); }
.sampling-kpi.kpi-filter-btn { --kpi-accent: var(--sampling-kpi-color, #1677ff); --kpi-accent-bg: var(--sampling-kpi-bg, #eef6ff); }
.tagtpl-kpi.kpi-filter-btn { --kpi-accent: var(--tagtpl-kpi-color, #1677ff); --kpi-accent-bg: var(--tagtpl-kpi-bg, #eef6ff); }
.pcc-kpi.kpi-filter-btn { --kpi-accent: var(--pcc-kpi-color, #1677ff); --kpi-accent-bg: var(--pcc-kpi-bg, #eef6ff); }
.mdp-kpi.kpi-filter-btn { --kpi-accent: var(--mdp-kpi-color, #1677ff); --kpi-accent-bg: var(--mdp-kpi-bg, #eef6ff); }
.ins-kpi.kpi-filter-btn { --kpi-accent: var(--ins-kpi-color, #1677ff); --kpi-accent-bg: var(--ins-kpi-bg, #eef6ff); }
.msa-kpi.kpi-filter-btn { --kpi-accent: var(--msa-kpi-color, #1677ff); --kpi-accent-bg: var(--msa-kpi-bg, #eef6ff); }
.crm-kpi.kpi-filter-btn { --kpi-accent: var(--crm-kpi-color, #1677ff); --kpi-accent-bg: var(--crm-kpi-bg, #eef6ff); }
.ar-kpi.kpi-filter-btn { --kpi-accent: var(--ar-kpi-color, #1677ff); --kpi-accent-bg: var(--ar-kpi-bg, #eef6ff); }
.mytask-kpi.kpi-filter-btn { --kpi-accent: var(--mytask-kpi-color, #1677ff); --kpi-accent-bg: var(--mytask-kpi-bg, #eef6ff); }
.completed-kpi.kpi-filter-btn { --kpi-accent: var(--completed-kpi-color, #1677ff); --kpi-accent-bg: var(--completed-kpi-bg, #eef6ff); }
.offline-import-kpi.kpi-filter-btn { --kpi-accent: var(--offline-import-kpi-color, var(--offline-kpi-color, #1677ff)); --kpi-accent-bg: var(--offline-import-kpi-bg, #eef6ff); }
.ua-kpi.kpi-filter-btn { --kpi-accent: var(--ua-kpi-color, #1677ff); --kpi-accent-bg: var(--ua-kpi-bg, #eef6ff); }
.mdm-status-kpi.kpi-filter-btn { --kpi-accent: var(--mdm-status-kpi-color, #1677ff); --kpi-accent-bg: var(--mdm-status-kpi-bg, #eef6ff); }
.fc-ledger-kpi.kpi-filter-btn { --kpi-accent: var(--fc-ledger-kpi-color, #1677ff); --kpi-accent-bg: var(--fc-ledger-kpi-bg, #eef6ff); }
.fo-kpi-card.kpi-filter-btn,
.fo-kpi.kpi-filter-btn { --kpi-accent: var(--fo-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--fo-kpi-color, #1677ff) 12%, #eef6ff); }
.qod-kpi.kpi-filter-btn { --kpi-accent: var(--qod-tone, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--qod-tone, #1677ff) 12%, #fff); }
.oqc-kpi.kpi-filter-btn { --kpi-accent: var(--oqc-kpi-color, #1677ff); --kpi-accent-bg: var(--oqc-kpi-bg, #eef6ff); }
.kb-kpi.kpi-filter-btn { --kpi-accent: var(--kb-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--kb-kpi-color, #1677ff) 12%, #eef6ff); }
.k3sync-card.kpi-filter-btn { --kpi-accent: var(--k3-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--k3-kpi-color, #1677ff) 12%, #eef6ff); }
.stats-cpk-kpi.kpi-filter-btn { --kpi-accent: var(--cpk-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--cpk-kpi-color, #1677ff) 12%, #eef6ff); }
.stats-merge-kpi.kpi-filter-btn { --kpi-accent: var(--merge-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--merge-kpi-color, #1677ff) 12%, #eef6ff); }

.prod-kpi-button:hover,
.kpi-filter-btn:hover {
  border-color: color-mix(in srgb, var(--kpi-accent, #1677ff) 35%, transparent);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--kpi-accent, #1677ff) 12%, transparent);
}

.prod-kpi-button:focus-visible,
.kpi-filter-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--kpi-accent, #1677ff) 55%, #fff);
  outline-offset: 2px;
}

.prod-kpi-button.is-active,
.kpi-filter-btn.is-active {
  border-color: var(--kpi-accent, #1677ff) !important;
  border-width: 2px !important;
  border-bottom-width: 4px !important;
  border-bottom-color: var(--kpi-accent, #1677ff) !important;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--kpi-accent, #1677ff) 22%, transparent),
    0 18px 38px color-mix(in srgb, var(--kpi-accent, #1677ff) 18%, transparent) !important;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--kpi-accent, #1677ff) 16%, transparent), transparent 8rem),
    linear-gradient(180deg, #fff, color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 90%, #fff)) !important;
  transform: translateY(-2px);
  z-index: 1;
}

.prod-kpi-button.is-active::before,
.kpi-filter-btn.is-active::before {
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--kpi-accent, #1677ff) 42%, transparent),
    0 0 0 5px color-mix(in srgb, var(--kpi-accent, #1677ff) 20%, transparent) !important;
}

.kpi-filter-btn.is-active span {
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 900;
}

.kpi-filter-btn.is-active strong,
.prod-kpi-button.is-active strong {
  color: var(--kpi-accent, #1677ff) !important;
}

.kpi-filter-btn.is-active:not(.prod-kpi) small {
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 800;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent);
}

.kpi-filter-btn:active:not(.kpi-stat-only),
.prod-kpi-button:active {
  transform: scale(0.985);
}

.kpi-filter-btn.is-active:active,
.prod-kpi-button.is-active:active {
  transform: translateY(-1px) scale(0.985);
}

.prod-kpi-button.is-active small::after,
.kpi-filter-btn.is-active:not(.prod-kpi) small::after {
  content: none;
}

.kpi-stat-only {
  cursor: default;
  pointer-events: none;
}

.prod-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--prod-kpi-bg, #eef6ff);
}

.prod-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 30px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--prod-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.prod-kpi span,
.prod-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.prod-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--prod-kpi-color, #1677ff);
  font-size: 26px;
  line-height: 1;
}

.prod-kpi-blue { --prod-kpi-color: #1677ff; --prod-kpi-bg: #e8f3ff; }
.prod-kpi-orange { --prod-kpi-color: #f59e0b; --prod-kpi-bg: #fff7e6; }
.prod-kpi-green { --prod-kpi-color: #16a34a; --prod-kpi-bg: #ecfdf3; }
.prod-kpi-red { --prod-kpi-color: #ef4444; --prod-kpi-bg: #fff1f2; }

.prod-scan-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  overflow-x: auto;
}

.prod-scan-strip strong {
  display: block;
  color: #1e293b;
  font-size: 13px;
}

.prod-scan-strip small {
  display: block;
  margin-top: 3px;
  color: #7b8798;
  font-size: 12px;
}

.prod-scan-actions {
  display: flex;
  gap: 8px;
}

.prod-scan-strip button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
  color: #41536b;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.prod-scan-strip button:hover {
  border-color: rgb(22 119 255 / 0.28);
  background: #eef6ff;
  color: #1677ff;
}

.prod-archive-layout {
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 16px;
}

.prod-archive-aside {
  top: 14px;
  padding: 14px;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.prod-aside-section {
  border-color: #e6edf5;
  background: #fbfdff;
}

.prod-stage-chip {
  border-color: #dfe7f1;
  background: #fff;
  color: #475569;
  font-weight: 650;
}

.prod-stage-chip--active {
  border-color: rgb(22 119 255 / 0.34);
  background: #eef6ff;
  color: #1677ff;
  box-shadow: none;
}

.prod-type-row {
  border-radius: 8px;
  color: #475569;
}

.prod-type-row--active {
  background: #eef6ff;
  border-left-color: #1677ff;
  color: #1677ff;
}

/* ========== 物料档案 · 修改 ========== */
#page-product-edit {
  background:
    radial-gradient(circle at 12% 0%, rgb(37 99 235 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-product-edit .ped-field-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#page-product-edit .ped-field-action-row input {
  flex: 1;
  min-width: 0;
}

.ped-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- 物料档案：顶部分段工作台（满宽，无左侧分区栏） ---- */
.ped-workspace {
  gap: 12px;
  min-height: calc(100dvh - 120px);
}

.ped-workspace-head .ped-workspace-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ped-workspace-head .ped-workspace-title-row h2 {
  margin: 0;
}

.ped-workspace-code {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.ped-workspace-status-pill {
  margin: 0;
}

.ped-workspace-health-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 10px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ped-workspace-health-chip strong {
  color: #2563eb;
  font-weight: 900;
}

.ped-workspace-health-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.ped-workspace-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 8px 10px;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
}

.ped-workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.ped-ws-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.ped-ws-tab:hover {
  background: #f8fafc;
  color: #0f172a;
}

.ped-ws-tab.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 -2px 0 #2563eb;
}

.ped-workspace-tabs-hint {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
  max-width: 280px;
}

.ped-workspace:not([data-ped-ws='basic']) .ped-workspace-tabs-hint {
  display: none;
}

.ped-workspace-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.ped-workspace-health-strip {
  padding: 12px 14px;
}

.ped-workspace:not([data-ped-ws="basic"]) .ped-workspace-health-strip {
  display: none;
}

.ped-workspace-health-strip .ped-health-main h3 {
  font-size: 14px;
}

.ped-workspace-health-strip .ped-health-ring {
  width: 44px;
  height: 44px;
  font-size: 11px;
}

.ped-workspace .ped-ws-panel {
  display: none !important;
}

.ped-workspace[data-ped-ws="basic"] .ped-ws-panel[data-ped-ws="basic"],
.ped-workspace[data-ped-ws="process"] .ped-ws-panel[data-ped-ws="process"],
.ped-workspace[data-ped-ws="drawing"] .ped-ws-panel[data-ped-ws="drawing"],
.ped-workspace[data-ped-ws="qc"] .ped-ws-panel[data-ped-ws="qc"],
.ped-workspace[data-ped-ws="more"] .ped-ws-panel[data-ped-ws="more"] {
  display: block !important;
}

.ped-workspace[data-ped-ws="more"] .ped-side-column.ped-ws-panel {
  display: grid !important;
  gap: 14px;
}

.ped-workspace[data-ped-ws="basic"] .ped-ws-basic-host,
.ped-workspace[data-ped-ws="process"] .ped-ws-basic-host,
.ped-workspace[data-ped-ws="drawing"] .ped-ws-basic-host,
.ped-workspace[data-ped-ws="more"] .ped-ws-basic-host {
  display: block;
}

.ped-workspace[data-ped-ws="qc"] .ped-lower-layout,
.ped-workspace[data-ped-ws="more"] .ped-lower-layout {
  display: block !important;
}

.ped-workspace[data-ped-ws="qc"] .ped-lower-layout {
  grid-template-columns: 1fr;
}

.ped-workspace[data-ped-ws="basic"] .ped-main-grid,
.ped-workspace[data-ped-ws="process"] .ped-main-grid,
.ped-workspace[data-ped-ws="drawing"] .ped-main-grid {
  grid-template-columns: 1fr;
}

.ped-workspace[data-ped-ws="more"] .ped-main-grid {
  grid-template-columns: 1fr;
}

.ped-workspace[data-ped-ws="more"] .ped-lower-main {
  display: none;
}

.ped-workspace[data-ped-ws="more"] .ped-lower-layout {
  grid-template-columns: 1fr;
}

.ped-workspace-foot {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px 16px;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 -8px 28px rgb(15 23 42 / 0.06);
}

.ped-workspace-foot.hidden {
  display: none !important;
}

.ped-workspace-foot-hint {
  display: grid;
  gap: 2px;
}

.ped-workspace-foot-hint strong {
  color: #0f172a;
  font-size: 13px;
}

.ped-workspace-foot-hint span {
  color: #64748b;
  font-size: 12px;
}

.ped-workspace-foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 960px) {
  .ped-workspace-tabs-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .ped-workspace-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .ped-workspace-tabs-hint {
    max-width: none;
  }

  .ped-workspace[data-ped-ws="more"] .ped-main-grid {
    grid-template-columns: 1fr;
  }
}

.ped-titlebar,
.ped-query-strip,
.ped-card,
.ped-side-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.ped-titlebar.qcos-subpage-hero {
  align-items: center;
  margin-bottom: 0;
  border-radius: 16px;
}

.ped-health-card,
.ped-save-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background:
    radial-gradient(circle at 4% 0%, rgb(37 99 235 / 0.1), transparent 18rem),
    linear-gradient(135deg, #fff, #f8fbff);
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.05);
}

.ped-health-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}

.ped-health-main h3,
.ped-save-next strong {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 850;
}

.ped-health-main h3 strong {
  color: var(--qcos-blue, #2563eb);
  font-size: 22px;
}

.ped-health-main p,
.ped-save-next p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.ped-health-ring {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 58%, transparent 59%),
    conic-gradient(var(--qcos-blue, #2563eb) var(--ped-health, 0%), #e5edf7 0);
  color: var(--qcos-blue-hover, #1d4ed8);
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgb(37 99 235 / 0.08);
}

.ped-health-tags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.ped-health-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.ped-health-tag.ok {
  color: #15803d;
  background: #dcfce7;
}

.ped-health-tag.warn {
  color: #b45309;
  background: #fef3c7;
}

.ped-health-actions,
.ped-save-next-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ped-save-next {
  border-color: #bbf7d0;
  background:
    radial-gradient(circle at 4% 0%, rgb(34 197 94 / 0.1), transparent 18rem),
    linear-gradient(135deg, #fff, #f7fff9);
}

.ped-title-main,
.ped-title-actions,
.ped-card-head,
.ped-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ped-title-actions,
.ped-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ped-title-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.ped-title-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e8f3ff, #fff);
  color: var(--qcos-blue, #2563eb);
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgb(37 99 235 / 0.16);
}

.ped-eyebrow,
.ped-section-kicker {
  display: inline-flex;
  margin: 0 0 5px;
  color: var(--qcos-blue, #2563eb);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ped-titlebar h2,
.ped-card-head h3,
.ped-side-card h3 {
  margin: 0;
  color: #172033;
  font-weight: 780;
}

.ped-titlebar.qcos-subpage-hero h2 {
  font-size: 22px;
}

.ped-titlebar.qcos-subpage-hero #ped-header-sub {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.ped-query-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.ped-query-label {
  flex: 0 0 auto;
  color: #172033;
  font-size: 12px;
  font-weight: 850;
}

.ped-global-q-input {
  flex: 1 1 auto;
  min-width: 180px;
  max-width: 420px;
}

.ped-query-strip label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.ped-query-spacer {
  flex: 1 1 auto;
}

.ped-query-strip input,
.ped-form-grid input,
.ped-form-grid select,
.ped-card .prod-textarea {
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.ped-query-strip input:focus,
.ped-form-grid input:focus,
.ped-form-grid select:focus,
.ped-card .prod-textarea:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.ped-query-strip input[type='search'] {
  max-width: 320px;
}

.ped-main-grid {
  min-width: 0;
}

.ped-main-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ped-card {
  padding: 16px;
}

.ped-card-head {
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.ped-card-head p {
  margin: 5px 0 0;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.5;
}

.ped-card-head h3,
.ped-side-card h3 {
  font-size: 15px;
}

.ped-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f8fbff);
}

.ped-status-banner.is-disabled {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff1f2, #fff7ed);
}

.ped-status-main,
.ped-status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ped-status-main {
  flex: 1 1 auto;
}

.ped-status-main strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.ped-status-main p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.ped-status-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgb(22 163 74 / 0.16);
}

.ped-status-banner.is-disabled .ped-status-pill {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgb(239 68 68 / 0.18);
}

.ped-status-reason {
  max-width: 360px;
  overflow: hidden;
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ped-form-section {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #edf2f7;
  border-radius: 14px;
  background: #fbfdff;
}

.ped-form-section--state {
  background: #fffaf7;
}

.ped-form-section--more,
.ped-form-section--drawing {
  background: #fff;
  border-color: #e8eef6;
}

.ped-form-section-head--plain {
  margin-bottom: 14px;
}

.ped-drawing-status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.ped-drawing-status[data-tone='ok'] {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ped-drawing-status[data-tone='warn'] {
  border-color: #fde68a;
  background: #fffbeb;
}

.ped-drawing-status[data-tone='empty'] {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.ped-drawing-status-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.ped-drawing-status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}

.ped-drawing-status[data-tone='ok'] .ped-drawing-status-pill {
  background: #dcfce7;
  color: #15803d;
}

.ped-drawing-status[data-tone='warn'] .ped-drawing-status-pill {
  background: #fef3c7;
  color: #b45309;
}

.ped-drawing-status-main strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.ped-drawing-status-main p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.ped-drawing-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.ped-form-grid--drawing-meta {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(140px, 200px) minmax(220px, 1fr);
  gap: 12px 18px;
  max-width: 860px;
  justify-content: start;
}

.ped-form-grid--drawing-meta .ped-drawing-field {
  grid-column: 1 / -1;
}

.ped-form-grid--drawing-notes .ped-drawing-field {
  grid-column: auto;
}

.ped-form-grid--drawing-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin-top: 10px;
  max-width: 860px;
}

.ped-drawing-notes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
  max-width: 860px;
}

.ped-drawing-notes > summary {
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
  user-select: none;
}

.ped-drawing-notes > summary::-webkit-details-marker {
  display: none;
}

.ped-drawing-notes > summary::before {
  content: '▸ ';
  color: #94a3b8;
}

.ped-drawing-notes[open] > summary::before {
  content: '▾ ';
}

#page-product-edit.ped-mode-view .ped-drawing-notes.is-empty {
  display: none;
}

.ped-form-section-head--plain strong {
  font-size: 14px;
  font-weight: 800;
}

.ped-form-grid--more-status {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(120px, 160px) minmax(200px, 1fr);
  gap: 12px 20px;
  max-width: 720px;
  justify-content: start;
}

.ped-more-admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}

.ped-more-admin-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ped-more-admin-copy strong {
  display: block;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.ped-more-admin-copy p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

.ped-more-admin-row .ped-field-override-strip {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.ped-more-notes {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
  max-width: 720px;
}

.ped-more-notes .prod-field-label {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.ped-more-query {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
  max-width: 720px;
}

.ped-more-query > summary {
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
  user-select: none;
}

.ped-more-query > summary::-webkit-details-marker {
  display: none;
}

.ped-more-query > summary::before {
  content: '▸ ';
  color: #94a3b8;
}

.ped-more-query[open] > summary::before {
  content: '▾ ';
}

.ped-more-query-body {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.ped-more-query-body .ped-global-q-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 360px;
}

.ped-form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.ped-form-section-head > span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  background: #eaf3ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

.ped-form-section--state .ped-form-section-head > span {
  background: #ffedd5;
  color: #c2410c;
}

.ped-form-section-head strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.ped-form-section-head p,
.ped-form-section-desc {
  margin: 2px 0 0;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.45;
}

/* 基础身份 / 业务分类：定宽列左对齐，避免整行被 1fr 拉稀 */
#ped-basic-card .ped-form-grid--identity {
  display: grid;
  grid-template-columns:
    minmax(148px, 200px)
    minmax(108px, 140px)
    minmax(200px, 280px)
    minmax(88px, 120px)
    minmax(72px, 100px);
  gap: 12px 28px;
  justify-content: start;
  align-items: start;
  max-width: 920px;
}

#ped-basic-card .ped-form-grid--classify {
  display: grid;
  grid-template-columns:
    minmax(120px, 140px)
    minmax(200px, 260px)
    minmax(120px, 160px);
  gap: 12px 28px;
  justify-content: start;
  align-items: start;
  max-width: 640px;
}

#ped-basic-card .ped-form-grid--identity .ped-field-wide,
#ped-basic-card .ped-form-grid--classify .ped-field-wide {
  min-width: 0;
}

#page-product-edit.ped-mode-edit #ped-basic-card .ped-form-grid--classify {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  max-width: 960px;
}

.ped-form-section--process {
  background: #fff;
  border-color: #e8eef6;
}

.ped-process-route-editor {
  display: grid;
  gap: 12px;
}

.ped-process-route-gap-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
}

.ped-process-route-gap-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ped-process-route-gap-copy strong {
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
}

.ped-process-route-gap-copy span {
  color: #a16207;
  font-size: 12px;
  line-height: 1.45;
}

.ped-process-route-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ped-route-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid #dbe7f7;
  border-radius: 12px;
  background: #f8fbff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.25;
}

.ped-route-chip-stage {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

.ped-route-chip:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
}

.ped-route-chip.is-on,
.ped-route-chip:disabled {
  color: #64748b;
  background: #f1f5f9;
  border-color: #e2e8f0;
  cursor: default;
}

.ped-route-chip.is-on .ped-route-chip-stage,
.ped-route-chip:disabled .ped-route-chip-stage {
  color: #94a3b8;
}

.ped-process-route-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-width: 820px;
}

.ped-process-route-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fff;
}

.ped-process-route-item.is-ok {
  border-color: #dcfce7;
  background: #f8fffb;
}

.ped-process-route-item.is-gap {
  border-color: #fde68a;
  background: #fffdf7;
  box-shadow: inset 3px 0 0 #f59e0b;
}

.ped-process-route-item.is-highlight {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

.ped-process-route-item small {
  grid-column: 2;
  color: #64748b;
  font-size: 12px;
}

.ped-route-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ped-route-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ped-route-stage {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.ped-route-stage.is-unknown {
  background: #fff7ed;
  color: #c2410c;
}

.ped-route-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.ped-route-rule-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.ped-route-rule-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.ped-route-rule--ok .ped-route-rule-pill {
  background: #ecfdf5;
  color: #047857;
}

.ped-route-rule--missing .ped-route-rule-pill,
.ped-route-rule--generic .ped-route-rule-pill {
  background: #ffedd5;
  color: #c2410c;
}

.ped-route-rule--pending .ped-route-rule-pill,
.ped-route-rule--unknown .ped-route-rule-pill {
  background: #f1f5f9;
  color: #64748b;
}

.ped-route-rule-detail {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.ped-route-fix-btn {
  flex: 0 0 auto;
}

.ped-route-ord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.ped-process-route-item.is-gap .ped-route-ord {
  background: #ffedd5;
  color: #c2410c;
}

.ped-process-route-item.is-ok .ped-route-ord {
  background: #dcfce7;
  color: #15803d;
}

.ped-process-route-item strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.ped-route-item-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.ped-route-item-actions .btn-link:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.ped-route-remove {
  color: #64748b;
}

.ped-route-remove:hover:not(:disabled) {
  color: #b42318;
}

.ped-process-route-head {
  align-items: center;
}

.ped-process-route-head > div {
  flex: 1;
  min-width: 0;
}

.ped-process-route-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #dbe3ef;
  border-radius: 12px;
  background: #fbfdff;
}

.ped-process-route-custom {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ped-process-route-custom input {
  flex: 1;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
}

.ped-process-route-preview {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.ped-mode-view .ped-process-route-custom,
.ped-mode-view .ped-route-item-actions,
.ped-mode-view .ped-process-route-chips {
  display: none !important;
}

#page-product-edit.ped-mode-view #ped-process-route-section {
  margin: 0;
  padding: 4px 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
}

#page-product-edit.ped-mode-view #ped-process-route-section .ped-form-section-desc {
  display: none;
}

#page-product-edit.ped-mode-view #ped-process-route-section .ped-form-section-head--plain strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .ped-process-route-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .ped-route-item-actions {
    grid-column: 2;
  }

  .ped-process-route-gap-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

.ped-form-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px 16px;
  margin-bottom: 12px;
}

.ped-form-section .ped-form-grid {
  margin-bottom: 0;
}

.ped-drawing-field,
.ped-disabled-reason-field {
  grid-column: span 2;
}

.ped-form-grid--inspect {
  grid-template-columns: minmax(220px, 360px);
}

.ped-form-grid label,
.ped-card .prod-field-label {
  color: #475569;
  font-size: 12px;
  font-weight: 760;
}

.ped-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ped-form-grid label.ped-field-missing input,
.ped-form-grid label.ped-field-missing select {
  border-color: #f59e0b;
  background: #fffbeb;
}

.ped-field-hint {
  color: #b45309;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.45;
}

.ped-field-hint:empty {
  display: none;
}

.ped-inline-note,
.ped-empty-note {
  margin: 8px 0 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.ped-template-actions,
.ped-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.ped-card .prod-field-label {
  margin: 4px 0 6px;
}

.ped-card .prod-textarea {
  min-height: 68px;
  resize: vertical;
}

.ped-lower-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 14px;
  align-items: start;
}

.ped-lower-main {
  min-width: 0;
}

.ped-mat-tabs {
  display: flex;
  width: 100%;
  margin-bottom: 0;
  padding: 0 12px;
  border: 1px solid #e6edf5;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: #fbfdff;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.035);
}

.ped-mat-tab {
  min-height: 44px;
  border-right: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-weight: 780;
}

.ped-mat-tab.active {
  color: #1677ff;
  border-bottom-color: #1677ff;
  background: transparent;
}

.ped-mat-pane {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  border-radius: 0 0 8px 8px;
}

.ped-pane-qc-overview,
#ped-pane-qc-overview {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#ped-pane-qc-overview .qc-overview-toolbar,
#ped-pane-qc-overview .qc-overview-notes,
#ped-pane-qc-overview .qc-overview-stages,
#ped-pane-qc-overview .qc-go-live-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ped-lower-main .ped-mat-pane {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.ped-pane-hint {
  color: #7b8798;
  font-size: 12px;
}

.ped-check-table {
  display: grid;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid #edf2f7;
  border-radius: 10px;
}

.ped-check-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) minmax(140px, 1.4fr) 64px 64px minmax(160px, 1.5fr);
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: #334155;
  font-size: 12px;
}

.ped-check-row:last-child {
  border-bottom: none;
}

.ped-check-row > * {
  padding: 9px 10px;
}

.ped-check-head {
  background: #fbfdff;
  color: #64748b;
  font-weight: 800;
}

.ped-check-row label {
  justify-self: center;
}

.ped-side-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 14px;
}

.ped-side-card {
  padding: 14px;
}

.ped-side-card .ped-section-kicker {
  margin-bottom: 6px;
}

.ped-side-card ol {
  margin: 10px 0 0 18px;
  padding: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.8;
}

.ped-overview {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 9px 10px;
  margin: 12px 0 0;
  font-size: 12px;
}

.ped-overview dt {
  color: #7b8798;
}

.ped-overview dd {
  margin: 0;
  color: #334155;
  font-weight: 760;
  word-break: break-all;
}

.ped-drill-link {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1677ff;
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  word-break: break-all;
}

.ped-drill-link:hover {
  color: #0958d9;
  text-decoration: underline;
}

.ped-source-box {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}

.ped-source-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.ped-source-row span {
  color: #7b8798;
}

.ped-source-row strong {
  min-width: 0;
  color: #334155;
  font-weight: 800;
  word-break: break-all;
}

.ped-audit-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ped-audit-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ped-audit-filter button {
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.ped-audit-filter button.active {
  background: #e8f3ff;
  color: #0958d9;
  border-color: rgb(22 119 255 / 0.28);
}

.ped-audit-item {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  gap: 2px 8px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.ped-audit-item:last-child {
  border-bottom: none;
}

.ped-audit-item span {
  color: #1677ff;
  font-weight: 850;
}

.ped-audit-item strong {
  color: #334155;
  font-weight: 800;
}

.ped-audit-item small {
  grid-column: 1 / -1;
  color: #94a3b8;
}

.ped-audit-item:hover span,
.ped-audit-item:hover strong {
  color: #0958d9;
}

.ped-audit-modal {
  position: fixed;
  inset: 0;
  z-index: 4300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(15 23 42 / 0.42);
  backdrop-filter: blur(8px);
}

.ped-audit-modal.hidden {
  display: none;
}

.ped-audit-modal-card {
  width: min(720px, 94vw);
  max-height: 86vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgb(15 23 42 / 0.24);
}

.ped-audit-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.ped-audit-modal-head h3 {
  margin: 0;
  color: #172033;
  font-size: 16px;
}

.ped-audit-detail-grid {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 14px 0;
  font-size: 12px;
}

.ped-audit-detail-grid dt {
  color: #7b8798;
}

.ped-audit-detail-grid dd {
  margin: 0;
  color: #334155;
  font-weight: 800;
}

.ped-audit-modal pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1280px) {
  .ped-form-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 1080px) {
  .ped-titlebar,
  .ped-card-head,
  .ped-health-card,
  .ped-save-next,
  .ped-status-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .ped-title-panel,
  .ped-title-actions,
  .ped-health-actions,
  .ped-save-next-actions,
  .ped-status-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .ped-status-reason {
    max-width: 100%;
    white-space: normal;
  }

  .ped-query-strip {
    flex-wrap: wrap;
  }

  .ped-query-spacer {
    display: none;
  }

  .ped-query-strip input[type='search'] {
    max-width: none;
    flex: 1 1 280px;
  }

  .ped-lower-layout {
    grid-template-columns: 1fr;
  }

  .ped-side-column {
    position: static;
  }
}

@media (max-width: 760px) {
  .ped-form-grid,
  .ped-form-grid--inspect {
    grid-template-columns: 1fr;
  }

  .ped-drawing-field,
  .ped-disabled-reason-field {
    grid-column: auto;
  }

  .ped-check-row {
    grid-template-columns: minmax(90px, 1fr) minmax(120px, 1fr) 52px 52px;
  }

  .ped-check-row > span:last-child {
    display: none;
  }
}

/* ========== 主数据 · 物料分组字典 ========== */
#page-mdm-product-categories {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.pcc-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pcc-hero,
.pcc-kpi,
.pcc-filter-panel,
.pcc-create-panel,
.pcc-toolbar,
.pcc-table-wrap {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.pcc-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

#page-mdm-product-categories .pcc-hero {
  align-items: flex-start;
  padding-top: 22px !important;
}

#page-mdm-product-categories .pcc-hero::before {
  content: none !important;
  display: none !important;
}

#page-mdm-product-categories .pcc-hero > * {
  position: relative;
  z-index: 1;
}

#page-mdm-product-categories .pcc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 4px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-mdm-product-categories .pcc-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-mdm-product-categories .pcc-hero-actions {
  position: relative;
  z-index: 2;
}

.pcc-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.pcc-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.pcc-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pcc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.pcc-kpi {
  position: relative;
  min-height: 98px;
  padding: 16px 18px 14px 64px;
}

.pcc-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 20px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--pcc-kpi-bg, #eef6ff);
}

.pcc-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 32px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pcc-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.pcc-kpi span,
.pcc-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.pcc-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: #172033;
  font-size: 26px;
  line-height: 1;
}

.pcc-kpi-blue { --pcc-kpi-color: #1677ff; --pcc-kpi-bg: #e8f3ff; }
.pcc-kpi-green { --pcc-kpi-color: #16a34a; --pcc-kpi-bg: #ecfdf3; }
.pcc-kpi-orange { --pcc-kpi-color: #f59e0b; --pcc-kpi-bg: #fff7e6; }
.pcc-kpi-cyan { --pcc-kpi-color: #0ea5e9; --pcc-kpi-bg: #e6f7ff; }
.pcc-kpi-purple { --pcc-kpi-color: #8b5cf6; --pcc-kpi-bg: #f5f3ff; }

.pcc-filter-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
}

.pcc-filter-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.pcc-filter-panel input,
.pcc-filter-panel select,
.pcc-create-panel input {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.pcc-filter-panel input:focus,
.pcc-filter-panel select:focus,
.pcc-create-panel input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.pcc-create-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.pcc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.pcc-toolbar span {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.pcc-table-wrap {
  overflow: hidden;
  padding: 0;
}

.pcc-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.pcc-table thead th {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.pcc-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
}

.pcc-table tbody tr:hover td {
  background: #f8fbff;
}

.pcc-table .mono {
  color: #1d4ed8;
  font-weight: 700;
}

.pcc-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: #64748b;
  font-size: 12px;
}

.pcc-pagination span:last-child {
  display: flex;
  gap: 8px;
}

@media (max-width: 1280px) {
  .pcc-kpi-grid,
  .pcc-filter-panel,
  .pcc-create-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .pcc-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .pcc-kpi-grid,
  .pcc-filter-panel,
  .pcc-create-panel {
    grid-template-columns: 1fr;
  }
}

.prod-archive-toolbar {
  padding: 16px;
}

.prod-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.prod-toolbar-head h3,
.prod-table-title h3,
.prod-action-copy strong {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 820;
}

.prod-toolbar-head p,
.prod-action-copy small {
  display: block;
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.45;
}

.prod-toolbar-actions {
  justify-content: flex-end;
}

.prod-toolbar-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top-color: #edf2f7;
}

.prod-toolbar-filters input,
.prod-toolbar-filters select,
.prod-quick-add input,
#page-products .filter-row input {
  min-height: 38px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.prod-toolbar-filters input:focus,
.prod-toolbar-filters select:focus,
.prod-quick-add input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.prod-quick-add,
#page-products .filter-row {
  padding: 13px 14px;
}

.prod-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.prod-action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#page-products .prod-ai-import--primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 16px;
  padding: 14px 16px;
}

#page-products .prod-ai-import--primary .prod-action-copy {
  flex: 1 1 280px;
  min-width: 0;
}

#page-products .prod-ai-import--primary .prod-ai-import-actions {
  flex: 1 1 320px;
  justify-content: flex-end;
}

#page-products .prod-more-tools {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
  box-shadow: none;
}

#page-products .prod-more-tools-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  color: #374151;
  font-size: 14px;
}

#page-products .prod-more-tools-summary::-webkit-details-marker {
  display: none;
}

#page-products .prod-more-tools-summary::before {
  content: '▸';
  margin-right: 6px;
  color: #6b7280;
}

#page-products .prod-more-tools[open] .prod-more-tools-summary::before {
  content: '▾';
}

#page-products .prod-more-tools-body {
  padding: 0 14px 14px;
  border-top: 1px solid #e5e7eb;
}

#page-products .prod-more-tools .prod-quick-add {
  display: block;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-products .prod-more-tools .prod-quick-add::before,
#page-products .prod-more-tools .prod-quick-add::after {
  display: none !important;
  content: none !important;
}

#page-products .prod-more-section-head {
  margin-bottom: 10px;
}

#page-products .prod-more-section-head h4 {
  margin: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
}

#page-products .prod-more-section-head .hint {
  margin: 4px 0 0;
  font-size: 13px;
}

#page-products .prod-quick-add-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

#page-products .prod-more-tools .prod-ai-settings {
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

#page-products .prod-more-tools .prod-ai-settings-summary {
  padding: 10px 12px;
}

.prod-quick-add,
.prod-ai-import {
  display: grid;
  grid-template-columns: minmax(170px, .9fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.prod-ai-import {
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 1fr) auto;
}

.prod-action-copy {
  min-width: 0;
}

.prod-quick-label {
  margin: 0;
  color: #64748b;
  font-weight: 750;
}

.prod-archive-table-wrap {
  overflow-x: auto;
}

.prod-table-title {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
}

.prod-archive-table {
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

.prod-archive-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.prod-archive-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
}

.prod-archive-table tbody tr:hover td {
  background: #f8fbff;
}

.prod-archive-table .mono,
.prod-code-cell .mono {
  color: #1d4ed8;
  font-weight: 700;
}

.prod-code-cell,
.prod-name-cell,
.prod-kind-cell,
.prod-customer-cell {
  min-width: 0;
}

.prod-code-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prod-name-cell strong,
.prod-name-cell small,
.prod-kind-cell strong,
.prod-kind-cell small,
.prod-customer-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-name-cell strong,
.prod-kind-cell strong {
  color: #172033;
  font-weight: 820;
}

.prod-name-cell small,
.prod-kind-cell small {
  margin-top: 4px;
  color: #7b8798;
  font-size: 11px;
}

.prod-kind-cell small {
  display: flex;
  gap: 5px;
}

.prod-iqc-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.prod-iqc-badge.is-ok {
  color: #047857;
  background: rgb(5 150 105 / 0.1);
}

.prod-iqc-badge.is-missing {
  color: #b91c1c;
  background: rgb(239 68 68 / 0.09);
}

.prod-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 34px 14px;
  color: #64748b;
  text-align: center;
}

.prod-empty-state strong {
  color: #172033;
  font-size: 15px;
}

.prod-empty-state span {
  max-width: 560px;
  font-size: 12px;
  line-height: 1.6;
}

.prod-archive-table .table-actions {
  white-space: nowrap;
}

.prod-archive-pagination {
  padding: 12px 14px;
}

@media (max-width: 1280px) {
  .prod-kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .prod-toolbar-filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .prod-quick-add-fields {
    grid-template-columns: 1fr;
  }

  .prod-action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .prod-hero,
  .prod-hero-main,
  .prod-hero-panel,
  .prod-hero-actions,
  .prod-scan-strip,
  .prod-toolbar-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .prod-scan-actions {
    flex-wrap: wrap;
  }

  .prod-quick-add,
  .prod-ai-import,
  #page-products .prod-quick-add-fields {
    grid-template-columns: 1fr;
  }

  #page-products .prod-ai-import--primary {
    flex-direction: column;
    align-items: stretch;
  }

  #page-products .prod-ai-import--primary .prod-ai-import-actions {
    justify-content: stretch;
  }

  .prod-kpi-grid,
  .prod-toolbar-filters {
    grid-template-columns: 1fr;
  }
}

/* ---- 录入页 ---- */
#page-entry {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.entry-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-hero,
.entry-date-row,
.entry-search-panel,
.entry-panel-modern,
.entry-feature-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.entry-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.entry-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.entry-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.entry-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
}

.entry-date-row > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.entry-date-row input,
.entry-search-panel input {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.entry-date-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.entry-date-search input {
  width: min(360px, 38vw);
  border-radius: 999px;
}

.entry-date-row input:focus,
.entry-search-panel input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.entry-search-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.entry-search-panel.entry-search-panel-collapsed label {
  display: none;
}

.entry-search-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.entry-search-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-empty-modern {
  min-height: 300px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.5), rgb(255 255 255 / 0.2));
}

.entry-empty-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
  border-radius: 24px;
  background: #e8f3ff;
  color: #1677ff;
  font-size: 40px;
  box-shadow: 0 12px 30px rgb(22 119 255 / 0.12);
}

.entry-empty-modern .btn {
  margin-top: 12px;
}

.entry-panel-modern {
  padding: 14px;
}

.entry-panel-modern .task-bar {
  border-color: #e6edf5;
  border-radius: 12px;
  box-shadow: none;
}

.entry-panel-modern .task-bar-tag {
  border-color: #dbeafe;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
}

.entry-claim-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
}

/* 订单要求卡：把订单行的重量/包装/条码/打标要求带到录入现场 */
.entry-order-req {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.entry-order-req-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.entry-order-req-head strong {
  font-size: 13px;
  color: #1d4ed8;
}

.entry-order-req-head span {
  font-size: 12px;
  color: #64748b;
}

.entry-order-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 14px;
}

.entry-order-req-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.entry-order-req-cell span {
  font-size: 11px;
  color: #64748b;
}

.entry-order-req-cell strong {
  font-size: 13px;
  color: #0f172a;
  word-break: break-all;
}

.entry-order-req-notes {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #92400e;
}

.entry-claim-banner-flash {
  animation: entry-claim-flash 0.9s ease;
}

@keyframes entry-claim-flash {
  0% { box-shadow: 0 0 0 0 rgb(245 158 11 / 0.55); }
  100% { box-shadow: 0 0 0 12px rgb(245 158 11 / 0); }
}

.entry-ledger-head {
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.entry-ledger-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.entry-ledger-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #e8f3ff;
  color: #1677ff;
  font-size: 22px;
}

.entry-ledger-title h3 {
  margin: 0;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
}

.entry-ledger-title p {
  margin: 4px 0 0;
  color: #7b8798;
  font-size: 12px;
}

.entry-ledger-pages {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: -44px 0 14px auto;
  color: #64748b;
  font-size: 12px;
}

.entry-ledger-pages input {
  width: 42px;
  min-height: 28px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  color: #334155;
}

.entry-ledger-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px 16px;
}

.entry-ledger-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.entry-ledger-grid input {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
}

.entry-feature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.entry-feature-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: 16px;
}

.entry-feature-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eef6ff;
  color: #1677ff;
  font-size: 22px;
}

.entry-feature-card strong {
  color: #172033;
  font-size: 14px;
}

.entry-feature-card p {
  margin: 0;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1280px) {
  .entry-search-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .entry-hero,
  .entry-date-row,
  .entry-date-search {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-date-search {
    width: 100%;
    margin-left: 0;
  }

  .entry-date-search input {
    width: 100%;
  }

  .entry-search-panel,
  .entry-feature-row {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52vh;
  color: hsl(var(--muted-foreground));
}

.empty-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: 0.85;
}

.empty-text {
  font-size: 17px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}

.empty-hint { font-size: 13px; color: hsl(var(--muted-foreground)); }

.task-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: none;
}

.task-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-bar-name {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.task-bar-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 0;
  background: #f0f2f5;
  color: #333;
  border: 1px solid #ddd;
}

.task-bar-progress {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-family: var(--mono);
}

.task-bar-instrument {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.task-bar-instrument-label {
  white-space: nowrap;
  font-weight: 600;
  color: #333;
}

.task-bar-instrument-input {
  width: 140px;
  max-width: 40vw;
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  font-family: var(--mono);
}

.task-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.inspect-body {
  display: flex;
  gap: 14px;
  min-height: calc(100vh - 180px);
}

.inspect-body--structured {
  flex-direction: column;
}

.inspect-tabs {
  width: 200px;
  flex-shrink: 0;
  border-radius: 0;
  background: #fff;
  border: 1px solid #ddd;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.entry-panel-modern .inspect-tabs {
  width: 220px;
  border-color: #e6edf5;
  border-radius: 14px;
  background: #fbfdff;
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.04);
}

.inspect-tab {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

.inspect-tab:last-child { border-bottom: none; }

.inspect-tab:hover {
  background: hsl(var(--accent));
}

.inspect-tab.active {
  background: hsl(var(--primary-soft));
  border-left: 3px solid hsl(var(--primary));
}

.inspect-tab-name {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.inspect-tab-spec {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-family: var(--mono);
}

.inspect-tab-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.badge-pass {
  font-size: 9px;
  background: rgba(74, 222, 128, 0.2);
  color: hsl(var(--success));
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 800;
}

.badge-fail {
  font-size: 9px;
  background: rgba(251, 113, 133, 0.2);
  color: hsl(var(--danger));
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 800;
}

.inspect-content {
  flex: 1;
  border-radius: 0;
  padding: 16px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
}

.entry-panel-modern .inspect-content {
  border-color: #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.04);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-panel-modern .content-header {
  margin: -2px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.content-title {
  font-size: 17px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.entry-panel-modern .content-title {
  color: #172033;
  font-size: 15px;
  font-weight: 800;
}

.entry-panel-modern .content-spec {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.content-spec {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  font-family: var(--mono);
}

.scp-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.scp-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.scp-scope-list {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}
.scp-scope-list strong {
  color: hsl(var(--foreground));
}
.scp-preview-body {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 360px;
  overflow: auto;
}
.scp-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sample-add-cell {
  cursor: pointer;
  justify-content: center;
  border-style: dashed;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font: inherit;
  min-height: 88px;
}
.sample-add-cell:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  background: hsl(var(--muted));
}
.sample-add-label {
  font-size: 12px;
  margin-top: 4px;
}
.content-open-hint {
  margin-top: 4px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

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

.sample-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  border-radius: var(--r-sm);
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.entry-panel-modern .sample-cell {
  align-items: stretch;
  padding: 10px;
  border-color: #edf2f7;
  border-radius: 12px;
  background: #fbfdff;
}

.sample-cell:hover {
  border-color: hsl(var(--ring));
}

.sample-cell.is-pass {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.35);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.08);
}

.sample-cell.is-fail {
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.35);
}

.sample-num {
  font-size: 10px;
  font-weight: 800;
  color: hsl(var(--muted-foreground));
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}

.entry-panel-modern .sample-num {
  margin-bottom: 8px;
  color: #64748b;
  text-align: left;
}

.measure-input {
  width: 100%;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  font-family: var(--mono);
  font-weight: 600;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.entry-panel-modern .measure-input {
  min-height: 36px;
  border-color: #dfe7f1;
  border-radius: 8px;
  background: #fff;
}

.entry-panel-modern .measure-input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

@media (max-width: 960px) {
  .entry-ledger-pages {
    justify-content: flex-start;
    margin: 0 0 14px;
  }

  .entry-ledger-grid {
    grid-template-columns: 1fr;
  }
}

.measure-input:focus {
  border-color: hsl(var(--ring));
  background: hsl(var(--accent));
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.measure-input.pass {
  color: hsl(var(--success));
}

.measure-input.fail {
  color: hsl(var(--danger));
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.sample-cell.shake { animation: shake 0.35s ease; }

/* ---- 表单行 ---- */
.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tpl-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.tpl-card small {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.page-header h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }

.part-card {
  background: hsl(var(--card));
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid hsl(var(--border));
}

.part-card h3 { font-size: 15px; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 4px; }

.part-card .part-code { color: hsl(var(--muted-foreground)); font-size: 12px; margin-bottom: 10px; }

.item-list { font-size: 12px; }

.item-list .item-row {
  display: flex;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid hsl(var(--border));
  align-items: center;
}

.item-list .item-row:last-child { border-bottom: none; }

.add-item-form { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.add-item-form input {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  width: 90px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  color: hsl(var(--foreground));
}

/* ---- 旧顶栏（遗留页面若引用）---- */
.topbar { height: 48px; background: #fff; border-bottom: 1px solid #ddd; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.logo { font-size: 20px; margin-right: 8px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { color: hsl(var(--muted-foreground)); text-decoration: none; font-size: 13px; padding: 6px 14px; border-radius: 8px; }
.nav-links a.active, .nav-links a:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.scan-input {
  width: 280px;
  padding: 8px 12px;
  border-radius: 10px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  color: hsl(var(--foreground));
}
.scan-input::placeholder { color: hsl(var(--muted-foreground)); }
.main { flex: 1; overflow-y: auto; padding: 12px 16px; }

/* ---- SPC 弹窗 ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3200;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 0;
  padding: 20px;
  width: 92%;
  max-width: 820px;
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid #ccc;
  box-shadow: 0 4px 24px rgb(0 0 0 / 0.15);
  pointer-events: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-narrow {
  max-width: 420px;
}

.crud-edit-modal {
  max-width: min(640px, 96vw);
  max-height: 90vh;
  overflow: auto;
}

.crud-edit-modal.crud-edit-modal-wide {
  max-width: min(720px, 96vw);
}

.crud-edit-modal .modal-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #475569;
}

.mdp-registry-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.crud-edit-modal .modal-body .crm-modal-actions,
.crud-edit-modal .modal-body .itr-form-actions,
.crud-edit-modal .modal-body .ins-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  grid-column: 1 / -1;
}

.fc-pdf-modal-content {
  max-width: min(1180px, 96vw);
  width: 96vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

.fc-pdf-frame {
  flex: 1;
  width: 100%;
  min-height: 520px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #f8fafc;
}

.fc-summary {
  margin-top: 6px;
  color: #475569;
  font-size: 12px;
}

.fc-summary summary {
  cursor: pointer;
  color: #1677ff;
}

.login-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 0;
}

.login-form label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-top: 6px;
}

.login-form input {
  font-family: var(--sans);
  padding: 8px 10px;
  border-radius: 0;
  font-size: 14px;
  color: #333;
  background-color: #fff;
  border: 1px solid #ddd;
  outline: none;
}

.login-form input:focus {
  border-color: hsl(var(--primary));
  outline: 1px solid hsl(var(--primary) / 0.35);
  outline-offset: 0;
}

.login-hint {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

.login-hint code {
  font-family: var(--mono);
  font-size: 11px;
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
  padding: 2px 6px;
  border-radius: 6px;
}

.auth-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  background: hsl(var(--accent));
  border: 1px solid hsl(var(--primary) / 0.12);
  color: hsl(var(--accent-foreground));
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.role-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-super_admin {
  background: hsl(270 95% 96%);
  color: hsl(270 60% 35%);
  border: 1px solid hsl(270 60% 88%);
}

.role-admin {
  background: hsl(199 89% 96%);
  color: hsl(201 90% 32%);
  border: 1px solid hsl(199 70% 88%);
}

.role-inspector {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.spc-select { margin-bottom: 14px; }

.spc-select label {
  display: inline-block;
  margin-right: 10px;
  font-size: 12px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spc-stats {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.spc-stat {
  text-align: center;
  min-width: 76px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}

.spc-stat .label {
  font-size: 10px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.spc-stat .value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.spc-stat .value.good { color: hsl(var(--success)); }
.spc-stat .value.warn { color: hsl(var(--warning)); }
.spc-stat .value.bad { color: hsl(var(--danger)); }

#spc-chart {
  border-radius: var(--r-sm);
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  z-index: 4200;
  animation: toastIn 0.35s var(--ease-out);
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-md);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.success {
  color: #ecfdf5;
  background: #15803d;
  border-color: rgba(34, 197, 94, 0.45);
}

.toast.error {
  color: #fff;
  background: #be123c;
  border-color: rgba(244, 63, 94, 0.45);
}

.toast.warning {
  color: #422006;
  background: #f59e0b;
  border-color: rgba(245, 158, 11, 0.5);
}

.toast.info {
  color: #eff6ff;
  background: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.45);
}

.status-pending { color: hsl(var(--warning)); font-weight: 700; }
.status-completed { color: hsl(var(--success)); font-weight: 700; }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-pill-pending {
  background: hsl(32 95% 94%);
  color: hsl(var(--warning));
}

.status-pill-sent {
  background: hsl(142 76% 94%);
  color: hsl(var(--success));
}

.status-pill-fail {
  background: hsl(0 72% 95%);
  color: hsl(var(--danger));
}

.cr-cell-brief {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cr-detail-body pre {
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.cr-detail-body p {
  margin-bottom: 8px;
  font-size: 13px;
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: hsl(var(--muted)); }
::-webkit-scrollbar-thumb {
  background: hsl(var(--border-strong));
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.35); }

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    max-height: min(52vh, 460px);
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 12px 12px;
    align-content: flex-start;
    align-items: stretch;
    box-shadow: var(--sidebar-shadow);
  }
  .sidebar-brand {
    width: 100%;
    margin: 0 4px 6px;
    padding: 14px 8px 14px;
    border-bottom-color: hsl(var(--sidebar-border));
  }
  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-content: flex-start;
    padding: 0 4px 8px;
    flex: 1 1 auto;
    min-height: 0;
  }
  .sidebar-footer {
    width: 100%;
    padding: 8px 8px 10px;
    margin-top: 0;
    order: 99;
  }
  .sidebar-profile {
    padding: 12px 14px;
  }
  .nav-section {
    width: 100%;
    margin-bottom: 4px;
  }
  .nav-section-toggle {
    width: 100%;
    padding-top: 14px;
    padding-left: 12px;
    font-size: 11px;
  }
  .sidebar-nav .nav-item {
    margin: 0;
    flex: 1 1 auto;
    min-width: calc(50% - 6px);
    justify-content: flex-start;
  }
  body.layout-erp .erp-body { flex-direction: column; }
  .app-main {
    padding: 12px 14px 16px;
  }
  .inspect-body { flex-direction: column; }
  .inspect-tabs {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    flex-shrink: 0;
  }
  .inspect-tab { min-width: 140px; border-bottom: none; border-right: 1px solid hsl(var(--border)); }
  .inspect-tab:last-child { border-right: none; }
  .sample-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .topbar { flex-direction: column; height: auto; padding: 10px; }
  .scan-input { width: 100%; }
  .iqc-toolbar-card { flex-direction: column; align-items: stretch; }
  .iqc-toolbar-filters { width: 100%; }
  .iqc-toolbar-q { min-width: 0; }
  .table-wrap.iqc-batch-table-wrap { max-height: 48vh; }
}

.muted-text {
  color: var(--text-muted);
  opacity: 1;
}

/* IQC · 来料批次页布局 */
#page-iqc-batches.iqc-batch-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#page-iqc-batches .iqc-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#page-iqc-batches .iqc-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
}

#page-iqc-batches .iqc-hero h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

#page-iqc-batches .iqc-hero p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

#page-iqc-batches .iqc-hero-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.iqc-workspace-card {
  padding: 0;
  overflow: hidden;
}

.iqc-workspace-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid hsl(var(--border));
  background: #fff;
}

.iqc-workspace-head-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.iqc-list-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f9;
}

.iqc-list-tab {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.iqc-list-tab.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.08);
}

.iqc-workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.iqc-workspace-bar.hidden {
  display: none !important;
}

.iqc-workspace-hint {
  margin: 0;
  flex: 1 1 260px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.iqc-workspace-card .iqc-toolbar-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.iqc-list-panel {
  min-width: 0;
}

.iqc-help-details {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.iqc-help-inline {
  margin-left: auto;
  border: 0;
  background: transparent;
}

.iqc-help-inline > .iqc-help-summary {
  padding: 6px 0;
}

.iqc-help-inline[open] {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: #f8fafc;
}

.iqc-help-inline[open] > .iqc-help-summary {
  padding: 0 0 8px;
  border-bottom: 1px solid hsl(var(--border));
}

.iqc-help-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  user-select: none;
}

.iqc-help-summary::-webkit-details-marker {
  display: none;
}

.iqc-help-summary-main {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.iqc-help-summary-main::before {
  content: '▸ ';
  font-size: 0.65rem;
  color: hsl(var(--primary));
}

.iqc-help-details[open] > .iqc-help-summary .iqc-help-summary-main::before {
  content: '▾ ';
}

.iqc-help-summary-sub {
  font-size: 0.8125rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.iqc-help-body {
  padding: 0 14px 14px;
  border-top: 1px solid hsl(var(--border));
}

.iqc-help-list {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.iqc-help-list li + li {
  margin-top: 6px;
}

.iqc-toolbar-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  justify-content: space-between;
}

.iqc-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1 1 min(260px, 100%);
}

.iqc-toolbar-q {
  min-width: min(100%, 200px);
  flex: 1 1 220px;
}

.iqc-toolbar-select {
  min-width: 132px;
}

.iqc-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.table-wrap.iqc-batch-table-wrap {
  max-height: min(62vh, 620px);
  overflow: auto;
}

@media (max-width: 900px) {
  .iqc-workspace-head-main {
    flex-direction: column;
    align-items: stretch;
  }

  .iqc-help-inline {
    margin-left: 0;
  }

  .iqc-list-tabs {
    width: 100%;
  }

  .iqc-list-tab {
    flex: 1;
    text-align: center;
  }
}

.iqc-batch-form {
  padding: 0;
  overflow: hidden;
}

.iqc-batch-modal-content {
  max-width: min(640px, 96vw);
}

.iqc-batch-stepbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 20px 14px;
  border-bottom: 1px solid #e5eaf2;
}

.iqc-batch-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.iqc-batch-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.iqc-batch-step.is-active {
  color: #1d4ed8;
}

.iqc-batch-step.is-active .iqc-batch-step-num {
  background: #2563eb;
  color: #fff;
}

.iqc-batch-step.is-done {
  color: #334155;
}

.iqc-batch-step.is-done .iqc-batch-step-num {
  background: #dbeafe;
  color: #1d4ed8;
}

.iqc-batch-step-sep {
  flex: 1;
  height: 1px;
  max-width: 72px;
  background: #e2e8f0;
}

.iqc-batch-step-panel {
  padding: 14px 20px 0;
}

.iqc-batch-step-panel.hidden {
  display: none;
}

.iqc-batch-lead {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.iqc-form-block {
  margin-bottom: 14px;
}

.iqc-form-block-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
}

.iqc-form-block-title span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.iqc-form-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.iqc-form-arrival {
  display: grid;
  grid-template-columns: 110px minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.iqc-form-more {
  margin: 0 0 4px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #f8fafc;
}

.iqc-form-more > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
  user-select: none;
}

.iqc-form-more > summary::-webkit-details-marker {
  display: none;
}

.iqc-form-more > summary::after {
  content: '▾';
  float: right;
  color: #94a3b8;
  font-size: 12px;
}

.iqc-form-more[open] > summary::after {
  content: '▴';
}

.iqc-form-more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px 12px;
}

.iqc-field-hint {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}

.iqc-batch-step-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px -20px 0;
  padding: 12px 20px 16px;
  border-top: 1px solid #e5eaf2;
  background: #fff;
}

.iqc-content-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 550;
  color: #334155;
}

.iqc-content-chip:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

@media (max-width: 640px) {
  .iqc-form-primary,
  .iqc-form-arrival,
  .iqc-form-more-grid {
    grid-template-columns: 1fr;
  }
}

.iqc-batch-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f5f6f8;
  border-bottom: 1px solid #ddd;
}

.iqc-batch-form-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.iqc-form-section {
  padding: 12px 16px 4px;
}

.iqc-form-section + .iqc-form-section {
  border-top: 1px solid hsl(var(--border));
  padding-top: 14px;
}

.iqc-form-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--sidebar-section-title));
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.iqc-form-section-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

.iqc-inline-hint {
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

.iqc-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid #ddd;
  background: #fafafa;
}

.iqc-suggest-text {
  white-space: pre-wrap;
  margin: 0 16px 14px;
  font-size: 0.75rem;
}

/* IQC · 通用说明块（供应商档案页） */
.iqc-help {
  margin-bottom: 12px;
  padding: 12px 14px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  border-left: 3px solid hsl(var(--primary));
}

.iqc-batch-form .iqc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 14px;
  margin-bottom: 0;
}

.iqc-batch-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.iqc-batch-form select,
.iqc-batch-form input[type="number"],
.iqc-batch-form input[type="date"],
.iqc-batch-form input[type="text"] {
  width: 100%;
}

/* 自动策略：横向「□ + 说明」 */
.iqc-batch-form label.iqc-auto-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  max-width: 100%;
}

.iqc-batch-form label.iqc-auto-row input[type='checkbox'] {
  margin-top: 2px;
  flex-shrink: 0;
}

.iqc-manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 14px;
  margin-bottom: 0;
}

.iqc-content-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.8125rem;
}

.iqc-content-row label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.iqc-content-chip input[type='checkbox'] {
  margin: 0;
  flex-shrink: 0;
}

.iqc-batch-step-panel > .iqc-suggest-text {
  margin: 4px 0 0;
}
.iqc-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.iqc-pill-warn {
  background: hsl(32 95% 93%);
  color: hsl(32 95% 28%);
}
.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.flex-grow {
  flex: 1 1 140px;
}

/* 主数据管理 · 分段控件式 Tab */
.mdm-tab-bar {
  display: inline-flex;
  gap: 0;
  margin-bottom: 12px;
  padding: 0;
  background: #f0f2f5;
  border-radius: 0;
  border: 1px solid #ddd;
  width: fit-content;
}

.mdm-tab {
  appearance: none;
  border: none;
  border-right: 1px solid #ddd;
  background: transparent;
  padding: 8px 16px;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mdm-tab:last-child {
  border-right: none;
}

.mdm-tab-active {
  background: #fff;
  color: hsl(var(--primary));
  box-shadow: none;
}

.prod-quality-panel {
  margin-bottom: 12px;
}

.prod-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 14px;
  margin-bottom: 10px;
}

.prod-quality-grid label,
.mdm-pe-grid label,
.mdm-pe-tol-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.prod-field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.prod-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 0;
  border: 1px solid #ddd;
  font-family: var(--sans);
  font-size: 0.8125rem;
  resize: vertical;
}

.mdm-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.mdm-pe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 14px;
  margin-bottom: 10px;
  align-items: end;
}

.mdm-pe-tol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  margin-bottom: 0;
  max-width: none;
}

.mdm-param-edit-modal {
  max-width: 640px;
  padding: 0;
}

.mdm-param-edit-modal .mdm-pe-header {
  align-items: flex-start;
  margin-bottom: 0;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #edf2f7;
}

.mdm-pe-header-text {
  min-width: 0;
  flex: 1;
  padding-right: 12px;
}

.mdm-param-edit-modal .mdm-pe-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.mdm-pe-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-all;
}

.mdm-pe-body {
  padding: 4px 20px 8px;
}

.mdm-pe-section {
  padding: 14px 0;
}

.mdm-pe-section + .mdm-pe-section {
  border-top: 1px solid #edf2f7;
}

.mdm-pe-section-title {
  margin: 0 0 12px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mdm-pe-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.mdm-pe-field input,
.mdm-pe-field select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.mdm-pe-field-full {
  display: block;
  margin-bottom: 12px;
}

.mdm-pe-field-full input {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  font-size: 13px;
}

.mdm-pe-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.mdm-pe-tol-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #2563eb;
  border-radius: 10px;
  background: #f8fafc;
}

.mdm-pe-tol-panel .mdm-pe-field input {
  background: #fff;
}

.mdm-pe-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 12px;
  align-items: center;
}

.mdm-pe-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid #edf2f7;
  background: #fafbfc;
}

@media (max-width: 560px) {
  .mdm-pe-grid-2,
  .mdm-pe-tol-grid {
    grid-template-columns: 1fr;
  }
}

.mdm-param-tpl-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mdm-param-tpl-toggle {
  flex-shrink: 0;
  min-width: 2rem;
  font-family: inherit;
}

.mdm-param-tpl-name {
  font-weight: 600;
  color: hsl(var(--primary));
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.mdm-param-tpl-name:hover {
  text-decoration: underline;
}

.mdm-param-detail-row td {
  padding: 0 !important;
  border-top: none !important;
  background: hsl(var(--muted) / 0.45);
}

.mdm-param-nested-wrap {
  padding: 10px 12px 14px;
}

.mdm-param-nested-table {
  width: 100%;
  margin: 0;
}

/* ========== 主数据 · 参数规范库 ========== */
#page-mdm-params {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.mdmp-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mdmp-hero,
.mdmp-date-row,
.mdmp-kpi,
.mdmp-create-panel,
.mdmp-filter-panel,
.mdmp-param-filter,
.mdmp-template-side,
.mdmp-param-table-wrap {
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

.mdmp-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(240 247 255 / 0.95)),
    radial-gradient(circle at 92% 12%, rgb(22 119 255 / 0.1), transparent 18rem);
}

.mdmp-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mdmp-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 21px;
  font-weight: 800;
}

.mdmp-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.mdmp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mdmp-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #667085;
  font-size: 12px;
}

.mdmp-date-row input {
  height: 30px;
  border: 1px solid #d9e4f2;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 12px;
}

.mdmp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.mdmp-kpi {
  position: relative;
  min-height: 88px;
  padding: 14px 16px 12px 56px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mdmp-kpi:hover {
  border-color: var(--mdmp-kpi-color, #1677ff);
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.08);
}

.mdmp-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 17px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--mdmp-kpi-bg, #eef6ff);
}

.mdmp-kpi::after {
  content: '';
  position: absolute;
  left: 26px;
  top: 27px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mdmp-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.mdmp-kpi span,
.mdmp-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.mdmp-kpi strong {
  display: block;
  margin: 7px 0 5px;
  color: #172033;
  font-size: 24px;
  line-height: 1;
}

.mdmp-kpi-blue { --mdmp-kpi-color: #1677ff; --mdmp-kpi-bg: #e8f3ff; }
.mdmp-kpi-cyan { --mdmp-kpi-color: #0ea5e9; --mdmp-kpi-bg: #e6f7ff; }
.mdmp-kpi-red { --mdmp-kpi-color: #ef4444; --mdmp-kpi-bg: #fff1f2; }
.mdmp-kpi-teal { --mdmp-kpi-color: #14b8a6; --mdmp-kpi-bg: #ecfeff; }
.mdmp-kpi-green { --mdmp-kpi-color: #16a34a; --mdmp-kpi-bg: #ecfdf3; }
.mdmp-kpi-purple { --mdmp-kpi-color: #8b5cf6; --mdmp-kpi-bg: #f3e8ff; }
.mdmp-kpi-orange { --mdmp-kpi-color: #f59e0b; --mdmp-kpi-bg: #fffbeb; }

#page-mdm-params .mdmp-kpi.kpi-filter-btn.is-active {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--kpi-accent, #1677ff) 16%, transparent),
    0 8px 18px color-mix(in srgb, var(--kpi-accent, #1677ff) 10%, transparent) !important;
  transform: none;
}

.mdmp-create-panel,
.mdmp-param-filter {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.mdmp-filter-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
}

.mdmp-filter-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.mdmp-create-panel input,
.mdmp-filter-panel input,
.mdmp-filter-panel select,
.mdmp-param-filter input,
.mdmp-param-filter select {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.mdmp-create-panel input:focus,
.mdmp-filter-panel input:focus,
.mdmp-filter-panel select:focus,
.mdmp-param-filter input:focus,
.mdmp-param-filter select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.mdmp-param-filter {
  grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr) auto;
}

.mdmp-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.mdmp-category-side,
.mdmp-template-side {
  overflow: hidden;
}

.mdmp-main-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.mdmp-main-col .mdmp-template-table-wrap {
  min-height: 620px;
}

.mdmp-category-nav {
  padding: 6px 8px 12px;
  max-height: min(72vh, 720px);
  overflow: auto;
}

.mdmp-cat-group {
  margin-top: 10px;
}

.mdmp-cat-group-title {
  padding: 4px 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mdmp-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.mdmp-cat-item::before,
.mdmp-cat-item::after {
  content: none !important;
  display: none !important;
}

.mdmp-cat-item:hover,
.mdmp-cat-item.is-active {
  background: #f0f7ff;
  border-color: #bfdbfe;
  color: #1677ff;
}

.mdmp-cat-item strong {
  font-weight: 600;
}

.mdmp-cat-item span {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.mdmp-cat-item.is-active span {
  background: #dbeafe;
  color: #1677ff;
}

.mdmp-selected-template-label {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #dbe4ef;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mdmp-table-head-stack {
  flex-wrap: wrap;
}

.mdmp-template-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mdmp-template-toolbar input {
  min-width: 200px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  font-size: 12px;
}

.mdmp-template-table tbody tr.is-active {
  background: #f0f7ff;
}

.mdmp-template-pick {
  padding: 0;
  border: 0;
  background: transparent;
  color: #334155;
  font-weight: 650;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
}

.mdmp-template-pick:hover {
  color: #1677ff;
  text-decoration: underline;
}

.mdmp-enabled-pill {
  display: inline-block;
  min-width: 40px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.mdmp-enabled-pill.is-on {
  background: #ecfdf3;
  color: #15803d;
}

.mdmp-enabled-pill.is-off {
  background: #f1f5f9;
  color: #64748b;
}

.mdmp-item-disabled td {
  color: #94a3b8;
}

.mdmp-item-disabled strong {
  color: #94a3b8;
}

.mdmp-param-filter {
  grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr) auto auto;
}

.mdmp-drawer-open {
  overflow: hidden;
}

.mdmp-detail-workspace {
  display: block;
  min-width: 0;
}

.mdmp-detail-workspace .mdmp-template-table-wrap {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 620px;
}

.mdmp-detail-pane {
  display: none;
  min-width: 0;
}

.mdmp-detail-workspace.is-open .mdmp-template-table-wrap {
  display: none;
}

.mdmp-detail-workspace.is-open .mdmp-detail-pane {
  display: block;
}

.mdmp-detail-workspace:not(.is-open) .mdmp-detail-panel-body {
  display: none !important;
}

.mdmp-detail-workspace .mdmp-drawer-panel,
.mdmp-detail-panel-body {
  width: 100%;
  min-height: 640px;
  max-height: none;
  position: static;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  border: 1px solid #e6edf7 !important;
  border-radius: 20px !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
  overflow: hidden;
  background: #fff;
}

.mdmp-detail-return-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #e6edf5;
  background: #fff;
}

.mdmp-detail-return-bar.hidden {
  display: none;
}

.mdmp-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  font-weight: 650;
  box-shadow: none;
}

.mdmp-detail-return-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #94a3b8;
}

.mdmp-detail-return-hint.hidden {
  display: none;
}

#page-mdm-params.is-detail-open .mdmp-hero,
#page-mdm-params.is-detail-open .mdmp-kpi-grid,
#page-mdm-params.is-detail-open .mdmp-filter-panel,
#page-mdm-params.is-detail-open .mdmp-create-panel,
#page-mdm-params.is-detail-open .mdmp-category-side {
  display: none !important;
}

.mdmp-detail-count {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

#mdm-template-edit-modal {
  background: rgb(15 23 42 / 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

body.layout-pro #mdm-template-edit-modal.modal,
body.layout-pro #mdmp-import-items-modal.modal,
body.layout-pro #ped-inspection-pool-modal.modal {
  inset: auto;
  left: 240px;
  right: 0;
  top: 56px;
  bottom: 0;
  width: auto;
  height: auto;
}

.mdmp-drawer {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  justify-content: flex-end;
  background: rgb(15 23 42 / 0.36);
}

.mdmp-drawer-panel {
  width: min(1040px, 92vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -20px 0 45px rgb(15 23 42 / 0.18);
}

.mdmp-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
}

.mdmp-drawer-head .mdmp-eyebrow,
.mdmp-drawer-head #mdmp-detail-subtitle {
  display: none;
}

.mdmp-drawer-head-main {
  min-width: 0;
}

.mdmp-drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mdmp-drawer-head h3 {
  margin: 4px 0 0;
  color: #172033;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mdmp-drawer-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.mdmp-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mdmp-meta-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #f8fbff;
}

.mdmp-meta-pill small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mdmp-meta-pill strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.mdmp-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
}

.mdmp-detail-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.mdmp-detail-search input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #dfe7f1;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
}

.mdmp-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 0;
}

.mdmp-detail-summary span {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6edf7;
  border-radius: 12px;
  background: #fff;
}

.mdmp-detail-summary strong {
  display: block;
  color: #172033;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mdmp-detail-summary small {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
}

.mdmp-detail-filter {
  margin: 14px 16px 0;
  padding: 12px;
  border: 1px solid #e6edf7;
  border-radius: 12px;
  background: #fff;
}

.mdmp-table-head-compact {
  padding: 10px 16px !important;
  min-height: 0;
}

.mdmp-table-head-compact p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.mdmp-drawer-panel .mdmp-param-table-wrap {
  flex: 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  min-height: 0;
}

.mdmp-drawer-panel .mdmp-inner-table {
  max-height: calc(100vh - 330px);
  overflow: auto;
}

.mdmp-detail-workspace .mdmp-drawer-panel .mdmp-inner-table,
.mdmp-detail-panel-body .mdmp-inner-table {
  max-height: min(68vh, 720px);
}

#mdmp-template-detail-drawer .mdmp-enable-stack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

#mdmp-template-detail-drawer .mdmp-enable-cell {
  white-space: nowrap;
}

#mdmp-template-detail-drawer .mdm-param-master-table {
  min-width: 980px;
}

#mdmp-template-detail-drawer .mdm-param-master-table thead th {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0;
}

#mdmp-template-detail-drawer .mdm-param-master-table tbody td {
  color: #0f172a;
  font-size: 13px;
}

#mdmp-template-detail-drawer .mdmp-param-code,
#mdmp-template-detail-drawer .mdmp-standard-token {
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0;
}

#mdmp-template-detail-drawer .mdmp-drawer-head h3 {
  font-weight: 800;
  letter-spacing: -0.01em;
}

#mdmp-template-detail-drawer .mdmp-detail-search input,
#mdmp-template-detail-drawer .btn,
#mdmp-template-detail-drawer .mdmp-meta-pill {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mdmp-template-table th:nth-child(2),
.mdmp-template-table td:nth-child(2) {
  min-width: 128px;
  white-space: nowrap;
}

.mdmp-template-table th:nth-child(1),
.mdmp-template-table td:nth-child(1) {
  min-width: 108px;
}

.mdmp-detail-workspace.is-open .mdmp-drawer-head .mdmp-eyebrow,
.mdmp-detail-workspace.is-open .mdmp-drawer-head #mdmp-detail-subtitle {
  display: block;
}

.mdmp-detail-workspace.is-open .mdmp-detail-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 720px;
}

.mdmp-detail-workspace.is-open .mdmp-meta-pill strong {
  max-width: none;
}

.mdmp-panel-head,
.mdmp-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
}

.mdmp-panel-head h3,
.mdmp-table-head h3 {
  margin: 0;
  color: #263445;
  font-size: 15px;
}

.mdmp-panel-head p,
.mdmp-table-head p {
  margin: 4px 0 0;
  color: #98a2b3;
  font-size: 12px;
}

.mdmp-template-list {
  padding: 8px;
  max-height: 560px;
  overflow: auto;
}

.mdmp-template-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.mdmp-template-item:hover,
.mdmp-template-item.is-active {
  background: #f0f7ff;
  border-color: #d6e8ff;
}

.mdmp-template-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mdmp-template-code {
  display: block;
  margin-bottom: 4px;
  color: #1677ff;
  font-size: 11px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.mdmp-template-main strong {
  display: block;
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mdmp-template-main small {
  display: block;
  margin-top: 3px;
  color: #98a2b3;
  font-size: 11px;
}

.mdmp-template-count {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef4ff;
  color: #175cd3;
  font-size: 11px;
  text-align: center;
}

.mdmp-template-actions {
  grid-column: 1 / -1;
  display: none;
  gap: 6px;
}

.mdmp-template-item:hover .mdmp-template-actions {
  display: flex;
}

.mdmp-template-empty {
  padding: 24px 12px;
  color: #98a2b3;
  font-size: 12px;
  text-align: center;
}

.mdmp-param-table-wrap {
  overflow: hidden;
  padding: 0;
}

.mdmp-table-actions {
  display: flex;
  gap: 8px;
}

.mdmp-inner-table {
  border: none;
  border-radius: 0;
  overflow: auto;
}

.mdmp-template-table,
.mdm-param-master-table,
.mdm-param-nested-table {
  border-collapse: separate;
  border-spacing: 0;
}

.mdmp-template-table thead th,
.mdm-param-master-table thead th,
.mdm-param-nested-table thead th {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.mdmp-template-table tbody td,
.mdm-param-master-table tbody td,
.mdm-param-nested-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  font-size: 13px;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mdm-param-master-table td strong {
  display: block;
  color: #0f172a;
  font-weight: 700;
}

.mdm-param-master-table td small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.mdmp-param-code {
  color: #1d4ed8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  font-weight: 600;
}

.mdmp-ctq-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #7e22ce;
  font-size: 11px;
  font-weight: 700;
}

.mdmp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #edf2f7;
  color: #667085;
  font-size: 12px;
}

.mdmp-template-table tbody tr:hover td,
.mdm-param-master-table tbody tr:hover td,
.mdm-param-nested-table tbody tr:hover td {
  background: #f8fbff;
}

.mdm-param-tpl-row .mdm-param-tpl-name {
  color: #1d4ed8;
  font-weight: 760;
}

.mdm-param-detail-row td {
  background: #f8fbff !important;
}

.mdm-param-nested-wrap {
  padding: 12px 14px 16px;
}

.mdm-param-nested-table {
  overflow: hidden;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #fff;
}

/* 参数规范：桌面用表格，窄屏用卡片（避免抽屉内重复渲染两套未样式内容） */
.mdm-param-mobile-cards {
  display: none;
}

.mdmp-drawer-panel .mdm-param-master-table {
  min-width: 980px;
}

.mdmp-item-name-cell strong {
  display: block;
  color: #263445;
  font-weight: 750;
  line-height: 1.45;
}

.mdmp-enable-cell {
  min-width: 72px;
}

.mdmp-enable-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mdmp-enable-stack .btn-xs {
  min-height: 26px;
  padding: 2px 8px;
  font-size: 11px;
}

.mdm-param-mobile-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgb(15 23 42 / 0.04);
}

.mdm-param-mobile-card.is-disabled {
  opacity: 0.72;
  background: #f8fafc;
}

.mdm-param-mobile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mdm-param-mobile-head strong {
  display: block;
  color: #172033;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.mdm-param-mobile-head small {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.45;
}

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

.mdm-param-mobile-grid > span {
  padding: 8px 10px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #fbfdff;
}

.mdm-param-mobile-grid b {
  display: block;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.mdm-param-mobile-grid small {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
}

.mdm-param-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 900px) {
  .mdmp-drawer-panel .mdm-param-master-table {
    display: none;
  }

  .mdmp-drawer-panel .mdm-param-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
}

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

  .mdmp-create-panel,
  .mdmp-filter-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .mdmp-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .mdmp-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .mdmp-hero-actions {
    justify-content: flex-start;
  }

  .mdmp-kpi-grid,
  .mdmp-create-panel,
  .mdmp-filter-panel,
  .mdmp-param-filter {
    grid-template-columns: 1fr;
  }
}

.mdm-status-add-title {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.mdm-status-add-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.mdm-status-desc-input {
  width: 100%;
  margin-top: 8px;
  font: inherit;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #d9e4f2;
  background: #fff;
  resize: vertical;
}

input.narrow-num {
  width: 5.5rem;
}

#page-mdm-status .mdm-inline-code {
  width: 10rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.85rem;
  border-radius: 6px;
}

#page-mdm-status .mdm-inline-full {
  min-width: 8rem;
  width: 100%;
  max-width: 14rem;
  border-radius: 6px;
}

#page-mdm-status .mdm-inline-ta {
  width: 100%;
  min-height: 2.5rem;
  font: inherit;
  resize: vertical;
  border-radius: 6px;
}

/* ========== 主数据 · 状态与判定 ========== */
#page-mdm-status {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 28rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.mdm-status-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mdm-status-hero,
.mdm-status-filter,
.mdm-status-section,
.mdm-status-help,
.mdm-status-kpi {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.04);
}

.mdm-status-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(238 247 255 / 0.96)),
    radial-gradient(circle at 88% 20%, rgb(22 119 255 / 0.12), transparent 18rem);
}

.mdm-status-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mdm-status-hero h2 {
  margin: 0;
  color: #1d3557;
  font-size: 22px;
  font-weight: 800;
}

.mdm-status-hero p {
  margin: 8px 0 0;
  max-width: 680px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.mdm-status-hero-actions,
.mdm-status-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mdm-status-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.mdm-status-date,
.mdm-status-search,
.mdm-status-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mdm-status-date span {
  color: #667085;
  font-size: 12px;
}

.mdm-status-filter input,
.mdm-status-filter select,
.mdm-status-add-panel input,
.mdm-status-add-panel select {
  height: 34px;
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #fff;
  color: #263445;
  font-size: 12px;
}

.mdm-status-search input {
  width: min(360px, 38vw);
}

.mdm-status-kpis {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mdm-status-kpi {
  position: relative;
  min-height: 108px;
  padding: 18px 18px 16px 68px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #e6edf5;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
  text-align: left;
}

.mdm-status-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: var(--mdm-status-kpi-bg, #e8f3ff);
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

.mdm-status-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mdm-status-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.78);
}

.mdm-status-kpi span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ai-text, #172033);
  font-size: 12px;
  font-weight: 900;
}

.mdm-status-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--mdm-status-kpi-color, #1677ff);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
}

.mdm-status-kpi small {
  display: block;
  max-width: 100%;
  color: var(--ai-muted, #64748b);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  word-break: keep-all;
}

.mdm-status-kpi-blue { --mdm-status-kpi-color: #1677ff; --mdm-status-kpi-bg: #e8f3ff; }
.mdm-status-kpi-green { --mdm-status-kpi-color: #16a34a; --mdm-status-kpi-bg: #ecfdf3; }
.mdm-status-kpi-orange { --mdm-status-kpi-color: #f59e0b; --mdm-status-kpi-bg: #fff7e6; }
.mdm-status-kpi-purple { --mdm-status-kpi-color: #8b5cf6; --mdm-status-kpi-bg: #f5f3ff; }

.mdm-status-kpi.kpi-filter-btn {
  width: 100%;
  min-width: 0;
}

.mdm-status-help {
  padding: 12px 14px;
}

.mdm-status-section {
  overflow: hidden;
}

.mdm-status-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #edf2f7;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.mdm-status-section-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e6f4ff;
  color: #0958d9;
  font-size: 11px;
  font-weight: 700;
}

.mdm-status-section-tag-green {
  background: #ecfdf3;
  color: #039855;
}

.mdm-status-section-head h3 {
  margin: 8px 0 4px;
  color: #263445;
  font-size: 16px;
}

.mdm-status-section-head p {
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.mdm-status-table-wrap {
  border: none;
  border-radius: 0;
}

.mdm-status-table th {
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.mdm-status-table td {
  vertical-align: middle;
}

.mdm-status-table tr.is-muted {
  opacity: 0.62;
}

.mdm-status-code {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
}

.mdm-status-switch {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 18px;
}

.mdm-status-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mdm-status-switch span {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.15s ease;
}

.mdm-status-switch span::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.2);
  transition: transform 0.15s ease;
}

.mdm-status-switch input:checked + span {
  background: #1677ff;
}

.mdm-status-switch input:checked + span::after {
  transform: translateX(16px);
}

.mdm-status-system-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 12px;
}

.mdm-status-empty {
  padding: 24px !important;
  color: #98a2b3;
  text-align: center;
}

.mdm-status-add-panel {
  padding: 14px 18px 16px;
  background: #f8fbff;
  border-top: 1px solid #edf2f7;
}

.mdm-status-add-title {
  margin: 0 0 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.mdm-status-add-row input[type='text'] {
  min-width: 180px;
}

@media (max-width: 900px) {
  .mdm-status-hero,
  .mdm-status-filter,
  .mdm-status-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .mdm-status-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mdm-status-search input {
    width: 100%;
  }
}

.mdm-status-h3 {
  font-size: 1rem;
  margin: 12px 0 8px;
}

.mdm-status-list {
  margin-left: 1.2em;
  line-height: 1.6;
  font-size: 0.875rem;
}

.muted-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 12px;
  opacity: 1;
}
}

.compact-help-details {
  margin-bottom: 12px;
}

.compact-help-sum {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
}

.compact-help-body {
  margin-top: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}

.compact-help {
  padding: 10px 12px;
  font-size: 0.8125rem;
}

.checkbox-inline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}

.checkbox-inline input {
  margin: 0;
}

.drawing-inheritance-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  cursor: pointer;
}

.drawing-inheritance-switch input { margin-top: 3px; }
.drawing-inheritance-switch span { display: grid; gap: 3px; }
.drawing-inheritance-switch small { color: #64748b; line-height: 1.4; }
.ai-item-lanes { min-width: 142px; }

.ai-lanes-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ai-lanes-picker summary {
  list-style: none;
  min-height: 42px;
  padding: 0 34px 0 14px;
  border: 1px solid #aeb8c6;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #f8fbff);
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  line-height: 42px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.ai-lanes-picker summary::-webkit-details-marker {
  display: none;
}

.ai-lanes-picker[open] summary {
  border-color: rgb(47 125 255 / 0.42);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1);
}

.ai-lanes-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--ai-line, #e6edf5);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.12);
}

.ai-lanes-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border-radius: 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ai-lanes-picker-option:hover {
  background: #f3f9ff;
}

.ai-lanes-picker-option input {
  flex: 0 0 auto;
  margin: 0;
  accent-color: #1677ff;
}

.ai-lanes-picker-option--clear {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgb(229 237 247 / 0.92);
}

#page-ai-review .ai-draft-detail-card .form-row {
  align-items: center;
}

#page-ai-review .ai-item-bulk-actions select.ai-lanes-multi {
  width: min(100%, 168px);
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding: 8px 10px !important;
  border-radius: 16px !important;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: middle;
}

#page-ai-review .ai-item-table select.ai-item-lanes {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
}

#page-ai-review #ai-item-tbody td {
  vertical-align: middle;
}

/* 检测项草稿表 · 紧凑行内编辑（避免全表 pill 控件） */
#page-ai-review .ai-item-bulk-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--ai-line, #e6edf5);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.06), transparent 10rem),
    linear-gradient(180deg, #fff, #f8fbff);
}

#page-ai-review .ai-item-bulk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

#page-ai-review .ai-item-bulk-head strong {
  color: var(--ai-text, #172033);
  font-size: 13px;
  font-weight: 900;
}

#page-ai-review .ai-item-bulk-head .hint {
  margin: 0;
  font-size: 12px;
}

#page-ai-review .ai-item-bulk-actions {
  align-items: center;
  margin: 0;
}

#page-ai-review .ai-item-table-wrap {
  overflow: auto;
  border: 1px solid var(--ai-line, #e6edf5);
  border-radius: 20px;
  background: #fff;
}

#page-ai-review .ai-item-table {
  min-width: 1080px;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

#page-ai-review .ai-item-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 8px;
  border-bottom: 1px solid #e6edf5;
  background: #f8fbff;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#page-ai-review .ai-item-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

#page-ai-review .ai-item-row:hover td {
  background: #fbfdff;
}

#page-ai-review .ai-item-row-balloon td {
  background: rgb(248 251 255 / 0.72);
}

#page-ai-review .ai-item-row-balloon:hover td {
  background: #f3f9ff;
}

#page-ai-review .ai-item-col-check { width: 36px; text-align: center; }
#page-ai-review .ai-item-col-balloon { width: 56px; text-align: center; }
#page-ai-review .ai-item-col-view { width: 92px; }
#page-ai-review .ai-item-col-name {
  width: 220px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-ai-review .ai-item-col-num { width: 72px; }
#page-ai-review .ai-item-col-kind { width: 88px; }
#page-ai-review .ai-item-col-source { width: 108px; }
#page-ai-review .ai-item-col-lanes { min-width: 132px; }
#page-ai-review .ai-item-col-ctq { width: 44px; text-align: center; }
#page-ai-review .ai-item-col-status { width: 72px; }

#page-ai-review .ai-item-read {
  display: block;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

#page-ai-review .ai-item-read-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
  color: #172033;
}

#page-ai-review .ai-item-read-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#page-ai-review .ai-item-read-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1677ff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

#page-ai-review .ai-item-read-pill.is-muted {
  background: #f1f5f9;
  color: #64748b;
}

#page-ai-review .ai-item-read-lanes {
  display: block;
  color: #475569;
  font-size: 11px;
  line-height: 1.4;
}

#page-ai-review .ai-item-read-lanes.is-unassigned {
  color: #d48806;
  font-weight: 600;
}

#page-ai-review .ai-item-ctq-yes {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #16a34a;
  font-size: 11px;
  font-weight: 850;
}

#page-ai-review .ai-item-row.is-editing td {
  background: #eef6ff !important;
}

#page-ai-review .ai-item-row.is-editing td:first-child {
  box-shadow: inset 3px 0 0 var(--ai-blue, #1677ff);
}

#page-ai-review .ai-item-workspace {
  display: block;
  min-width: 0;
}

#page-ai-review .ai-item-editor-park {
  display: none;
}

#page-ai-review .ai-item-edit-row > td {
  padding: 0;
  background: #f4f8fd;
  border-bottom: 1px solid #d7e4f4;
  box-shadow: inset 3px 0 0 var(--ai-blue, #1677ff);
}

#page-ai-review .ai-item-edit-row.hidden {
  display: none;
}

#page-ai-review .ai-item-edit-panel {
  display: flex;
  flex-direction: column;
  max-height: none;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible;
  background: transparent;
}

#page-ai-review .ai-item-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 0;
  border-bottom: 0;
}

#page-ai-review .ai-item-edit-head h4 {
  margin: 0;
  color: var(--ai-text, #172033);
  font-size: 13px;
  font-weight: 800;
}

#page-ai-review .ai-item-edit-head .hint {
  margin: 2px 0 0;
  font-size: 12px;
}

#page-ai-review .ai-item-edit-head .hint:empty {
  display: none;
}

#page-ai-review .ai-item-edit-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.8fr) minmax(110px, 1fr) repeat(3, minmax(72px, 0.55fr)) minmax(104px, 0.8fr) minmax(104px, 0.8fr) auto;
  gap: 8px 12px;
  align-items: end;
  padding: 10px 16px 4px;
  overflow: visible;
}

#page-ai-review .ai-item-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ai-muted, #64748b);
  font-size: 12px;
  font-weight: 750;
}

#page-ai-review .ai-item-edit-form .ai-item-edit-ctq {
  flex-direction: row;
  align-items: center;
  align-self: end;
  min-height: 36px;
  white-space: nowrap;
  font-weight: 700;
}

#page-ai-review .ai-item-edit-lanes-field {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgb(229 237 247 / 0.92);
  border-radius: 10px;
  background: #fff;
}

#page-ai-review .ai-item-edit-lanes-field legend {
  padding: 0 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

#page-ai-review .ai-item-edit-lanes-field .hint {
  margin: 0 0 6px;
  font-size: 12px;
}

#page-ai-review .ai-item-edit-lanes-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#page-ai-review .ai-item-edit-lane-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#page-ai-review .ai-item-edit-lane-option:hover {
  background: #eef6ff;
}

#page-ai-review .ai-item-edit-lane-option:has(input:checked) {
  border-color: #2563eb;
  background: #eef4ff;
  color: #1d4ed8;
}

#page-ai-review .ai-item-edit-lane-option input {
  margin: 0;
  accent-color: #2563eb;
}

#page-ai-review .ai-item-edit-form input,
#page-ai-review .ai-item-edit-form select {
  min-height: 36px !important;
  border-color: #d7dee8 !important;
  border-radius: 8px !important;
  background: #fff !important;
}

#page-ai-review .ai-item-edit-foot {
  padding: 4px 16px 12px;
  border-top: 0;
}

#page-ai-review .ai-item-edit-status {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  #page-ai-review .ai-item-edit-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #page-ai-review .ai-item-edit-form > label:first-of-type {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  #page-ai-review .ai-item-edit-form {
    grid-template-columns: 1fr 1fr;
  }

  #page-ai-review .ai-item-edit-form > label:first-of-type,
  #page-ai-review .ai-item-edit-lanes-field {
    grid-column: 1 / -1;
  }

  #page-ai-review .ai-item-edit-panel {
    max-height: none;
  }
}

#page-ai-review .ai-item-col-tol {
  background: rgb(248 251 255 / 0.65);
}

#page-ai-review .ai-item-table thead .ai-item-col-tol {
  background: #eef6ff;
}

#page-ai-review .ai-item-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

#page-ai-review .ai-item-status-badge.is-included {
  background: #ecfdf5;
  color: #047857;
}

#page-ai-review .ai-item-status-badge.is-pending-include {
  background: #fff7ed;
  color: #c2410c;
}

.mdmp-import-items-list {
  max-height: 52vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
}

.mdmp-import-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.mdmp-import-item small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.mdmp-import-item.is-imported {
  background: #f8fafc;
  color: #94a3b8;
}

/* Ecogrid：状态圆点 · 迷你指标（供表格/卡片复用） */
.status-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.status-dot--success {
  background: hsl(var(--success));
  box-shadow: 0 0 0 3px hsl(var(--success) / 0.18);
}

.status-dot--warning {
  background: hsl(var(--warning));
  box-shadow: 0 0 0 3px hsl(var(--warning) / 0.18);
}

.status-dot--danger {
  background: hsl(var(--danger));
  box-shadow: 0 0 0 3px hsl(var(--danger) / 0.18);
}

.status-dot--neutral {
  background: hsl(var(--muted-foreground));
  opacity: 0.45;
}

.stat-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.stat-mini-card {
  padding: 12px 14px;
  border-radius: 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: none;
}

.stat-mini-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.stat-mini-card-icon--blue {
  background: hsl(var(--primary-soft));
  color: hsl(var(--primary));
}

.stat-mini-val {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: hsl(var(--foreground));
}

.stat-mini-label {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

@media (max-width: 1100px) {
  .app-page-toolbar .topbar-date-range {
    width: 100%;
    order: 2;
  }

  .app-page-toolbar-spacer {
    display: none;
  }

  .app-page-toolbar .topbar-tools {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 248px;
  }

  .app-main {
    padding: 14px 14px 18px;
  }
}

/* ---------- 录入表单中心（QData 风格台账） ---------- */
.fc-tabs {
  margin-bottom: 14px;
}

.fc-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.fc-tree {
  width: 260px;
  flex-shrink: 0;
  padding: 14px 14px 16px;
}

.fc-tree-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 10px;
}

.fc-tree-group {
  margin-bottom: 14px;
}

.fc-tree-node {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  margin: 2px 0;
  border: none;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: #333;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}

.fc-tree-lane-head {
  font-weight: 700;
  font-size: 12px;
  color: hsl(var(--primary));
}

.fc-tree-leaf {
  padding-left: 18px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.fc-tree-node:hover {
  background: hsl(var(--muted));
}

.fc-tree-node-active {
  background: hsl(var(--primary-soft));
  color: hsl(var(--primary));
  font-weight: 600;
}

.fc-tree-line-wrap {
  margin: 10px 0 14px;
  padding-left: 6px;
  border-left: 2px solid hsl(var(--border));
}

.fc-tree-line-label {
  font-size: 11px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  margin: 6px 0 8px;
  letter-spacing: 0.02em;
}

.fc-tree-process-label {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 8px 0 4px;
  padding-left: 8px;
}

.reporttpl-hero,
.reporttpl-editor,
.reporttpl-list-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
  padding: 16px;
  margin-bottom: 14px;
}

.reporttpl-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reporttpl-hero h2 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.reporttpl-hero p {
  margin: 0;
  color: #64748b;
}

.reporttpl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reporttpl-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.reporttpl-json-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.reporttpl-form-grid label,
.reporttpl-json-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.reporttpl-form-grid input,
.reporttpl-form-grid select,
.reporttpl-json-grid textarea {
  width: 100%;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: #0f172a;
  background: #fff;
}

.reporttpl-json-grid textarea {
  font-family: var(--mono);
  font-size: 12px;
  resize: vertical;
}

.reporttpl-layout-helper {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.reporttpl-layout-helper label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.reporttpl-layout-helper input {
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.reporttpl-preview-modal,
.mdm-template-edit-modal {
  max-width: min(980px, 94vw);
}

.mdm-template-edit-modal {
  width: min(780px, calc(100vw - 32px));
  max-width: 780px;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.24);
}

.mdm-template-edit-modal .modal-header {
  align-items: flex-start;
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e8eef6;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.mdm-template-edit-heading {
  display: grid;
  gap: 4px;
}

.mdm-template-edit-kicker {
  color: #1677ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mdm-template-edit-heading h3 {
  margin: 0;
  color: #172033;
  font-size: 18px;
}

.mdm-template-edit-heading p {
  margin: 0;
  color: #718096;
  font-size: 12px;
  line-height: 1.55;
}

.mdm-template-edit-modal .btn-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.mdm-template-edit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
  padding: 18px 22px 20px;
}

.mdm-template-edit-form label {
  min-width: 0;
  gap: 7px;
  line-height: 1.35;
}

.mdm-template-edit-form input,
.mdm-template-edit-form select {
  min-height: 38px;
}

.mdm-template-edit-form .mdm-template-report-field {
  grid-column: 1 / -1;
}

.mdm-template-edit-section-title {
  grid-column: 1 / -1;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.mdm-template-edit-section-title:not(:first-child) {
  margin-top: 4px;
}

.mdm-template-edit-help {
  grid-column: 1 / -1;
  margin: -5px 0 0;
  color: #718096;
  font-size: 11px;
  line-height: 1.55;
}

#mdm-tpl-edit-report-template {
  min-height: 42px;
  padding-right: 36px;
  font-weight: 760;
  text-overflow: ellipsis;
}

.mdm-template-edit-actions {
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 14px 22px;
  border-top: 1px solid #e8eef6;
  background: #f8fafc;
}

.mdm-template-edit-actions .btn {
  min-width: 88px;
}

@media (max-width: 760px) {
  .mdm-template-edit-form {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .mdm-template-edit-modal .modal-header,
  .mdm-template-edit-actions {
    padding-inline: 16px;
  }

  .mdm-template-edit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mdm-template-edit-actions .btn {
    width: 100%;
  }
}

.reporttpl-preview-body {
  background: #f1f5f9;
  padding: 16px;
  border-radius: 12px;
}

.reporttpl-preview-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
}

.reporttpl-preview-notice strong {
  white-space: nowrap;
}

.reporttpl-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
}

.reporttpl-preview-paper {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  background: #fff;
  border: 1px solid #d9e2ef;
  box-shadow: 0 18px 45px rgb(15 23 42 / 0.12);
}

.reporttpl-preview-head {
  display: grid;
  gap: 4px;
  text-align: center;
  margin-bottom: 18px;
}

.reporttpl-preview-head span,
.reporttpl-preview-head small {
  color: #64748b;
  font-size: 12px;
}

.reporttpl-preview-head strong {
  color: #0f172a;
  font-size: 22px;
}

.reporttpl-preview-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid #d9e2ef;
  border-right: none;
  border-bottom: none;
  margin-bottom: 16px;
}

.reporttpl-preview-fields div {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 8px;
  border-right: 1px solid #d9e2ef;
  border-bottom: 1px solid #d9e2ef;
}

.reporttpl-preview-fields span {
  font-size: 12px;
  color: #64748b;
}

.reporttpl-preview-fields em {
  color: #0f172a;
  font-style: normal;
}

.reporttpl-preview-section {
  margin-top: 14px;
}

.reporttpl-preview-section h4 {
  margin: 0 0 8px;
  color: #0f172a;
}

.reporttpl-preview-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.reporttpl-preview-section th,
.reporttpl-preview-section td {
  border: 1px solid #d9e2ef;
  padding: 7px 8px;
  text-align: left;
}

.reporttpl-preview-section th {
  background: #f8fafc;
}

.reporttpl-preview-sign {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  color: #334155;
}

.field-attention {
  outline: 3px solid rgb(47 125 255 / 0.2) !important;
  border-color: #2f7dff !important;
}

.fc-plan-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(90deg, #eff6ff, #f8fbff);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.mdmp-report-missing {
  color: #dc2626 !important;
  font-weight: 800;
}

.mdmp-report-ok {
  color: #1677ff !important;
}

.fc-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: hsl(var(--accent));
  border: 1px solid hsl(var(--border));
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--accent-foreground));
}

.tpl-tree-fields {
  margin-top: 10px;
  flex-wrap: wrap;
}

.tpl-tree-fields input {
  flex: 1;
  min-width: 140px;
}

.fc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fc-flow-board {
  padding: 12px 14px;
  margin-bottom: 12px;
}

#page-flow-overview .fc-flow-board {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#page-flow-overview .fc-flow-head,
#page-flow-overview .fc-flow-hint {
  display: none;
}

.fc-flow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.fc-flow-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex-shrink: 0;
}

.fc-flow-hint {
  margin: 0 0 12px;
  line-height: 1.45;
}

.fc-flow-content {
  overflow-x: visible;
  padding-bottom: 0;
}

.fc-flow-overview-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fo-dashboard {
  gap: 14px;
}

.fo-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid #e6edf8;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fbff, #ffffff);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.04);
}

.fo-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.fo-hero h2 {
  margin: 0 0 6px;
  color: #0f2f5f;
  font-size: 22px;
}

.fo-hero p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.fo-hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.fo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.fo-kpi {
  position: relative;
  min-height: 108px;
  padding: 18px 18px 16px 68px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 26px rgb(15 23 42 / 0.045);
  cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.fo-kpi:hover {
  transform: translateY(-1px);
  border-color: rgb(22 119 255 / 0.28);
  box-shadow: 0 14px 30px rgb(15 23 42 / 0.08);
}

.fo-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--fo-kpi-bg, #eef6ff);
}

.fo-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fo-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.fo-kpi span,
.fo-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.fo-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--fo-kpi-color, #1677ff);
  font-size: 25px;
  line-height: 1;
}

.fo-kpi-blue { --fo-kpi-color: #1677ff; --fo-kpi-bg: #e8f3ff; }
.fo-kpi-green { --fo-kpi-color: #16a34a; --fo-kpi-bg: #ecfdf3; }
.fo-kpi-red { --fo-kpi-color: #ef4444; --fo-kpi-bg: #fff1f2; }
.fo-kpi-orange { --fo-kpi-color: #f59e0b; --fo-kpi-bg: #fff7e6; }
.fo-kpi-purple { --fo-kpi-color: #7c3aed; --fo-kpi-bg: #f5f3ff; }

.fo-kpi.kpi-filter-btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.fo-kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid #e8eef7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
}

.fo-kpi-card strong {
  display: block;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.1;
}

.fo-kpi-card span {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.fo-kpi-card small {
  display: block;
  margin-top: 5px;
  color: #0f9f6e;
  font-size: 11px;
}

.fo-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e8f3ff;
}

.fo-kpi-pass .fo-kpi-icon { background: #dcfce7; }
.fo-kpi-fail .fo-kpi-icon { background: #fee2e2; }
.fo-kpi-progress .fo-kpi-icon { background: #fef3c7; }
.fo-kpi-pending .fo-kpi-icon { background: #ede9fe; }

.fo-flow-panel,
.fo-card {
  border: 1px solid #e8eef7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
}

.fo-flow-panel {
  padding: 18px 20px 20px;
}

.fo-section-head,
.fo-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #0f2f5f;
  font-size: 14px;
}

.fo-section-head span,
.fo-card-head span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.fo-process-scroll {
  overflow-x: auto;
  padding: 20px 10px 24px;
  scrollbar-width: thin;
}

.fo-process-line {
  min-width: 1540px;
  gap: 20px;
}

.fo-process-step {
  flex: 0 0 auto;
}

.fo-stage-box {
  min-width: 174px;
  min-height: 96px;
  padding: 14px 16px;
  border-radius: 12px;
  border-color: #dfe8f5;
  background: linear-gradient(180deg, #fff, #f9fbff);
}

.fo-clickable {
  cursor: pointer;
  font: inherit;
}

.fo-stage-box.fo-clickable {
  text-align: left;
}

.fo-clickable:hover {
  border-color: #1677ff;
  box-shadow: 0 10px 24px rgb(22 119 255 / 0.14);
}

.fo-stage-box strong {
  display: block;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.25;
}

.fo-stage-box em {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.fo-stage-box[data-state='pass'] { border-color: #86efac; background: #f0fdf4; }
.fo-stage-box[data-state='fail'] { border-color: #fca5a5; background: #fff1f2; }
.fo-stage-box[data-state='in_progress'] { border-color: #fcd34d; background: #fffbeb; }

.fo-check-stack {
  display: grid;
  grid-template-rows: repeat(3, 76px);
  gap: 16px;
  min-width: 132px;
  place-items: center;
}

.fo-check-diamond {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transform: rotate(45deg);
  box-shadow: 0 8px 18px rgb(15 23 42 / 0.06);
}

button.fo-check-diamond {
  padding: 0;
  cursor: pointer;
}

.fo-check-diamond-inner {
  display: flex;
  width: 96px;
  transform: rotate(-45deg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}

.fo-check-diamond b {
  color: #334155;
  font-size: 10.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.fo-check-diamond small {
  color: #64748b;
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
}

.fo-check-diamond[data-state='pass'] { border-color: #86efac; background: #dcfce7; }
.fo-check-diamond[data-state='fail'] { border-color: #fca5a5; background: #fee2e2; }
.fo-check-diamond[data-state='in_progress'] { border-color: #fcd34d; background: #fef3c7; }

.fo-arrow {
  color: #94a3b8;
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
}

.fo-bottom-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(300px, 1.15fr) minmax(260px, 1fr) minmax(220px, 0.85fr);
  gap: 12px;
}

.fo-card {
  min-height: 246px;
  padding: 16px;
}

.fo-trend-svg {
  width: 100%;
  height: 188px;
}

.fo-trend-svg text {
  fill: #94a3b8;
  font-size: 10px;
}

.fo-donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 174px;
}

.fo-donut {
  width: 158px;
  height: 158px;
  flex: 0 0 158px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: conic-gradient(#34d399 0 var(--pass), #fb7185 var(--pass) var(--fail-end), #fbbf24 var(--fail-end) var(--progress-end), #a78bfa var(--progress-end) 100%);
  color: #0f172a;
  box-shadow: inset 0 0 0 22px #fff, 0 8px 22px rgb(15 23 42 / 0.06);
}

.fo-donut strong {
  font-size: 24px;
}

.fo-donut span {
  margin-top: -18px;
  color: #64748b;
  font-size: 11px;
}

.fo-donut-legend {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 12px;
}

.fo-donut-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fo-donut-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.fo-donut-legend .is-pass { background: #34d399; }
.fo-donut-legend .is-fail { background: #fb7185; }
.fo-donut-legend .is-progress { background: #fbbf24; }
.fo-donut-legend .is-pending { background: #a78bfa; }

.fo-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.fo-rank-table th,
.fo-rank-table td {
  padding: 7px 4px;
  border-bottom: 1px solid #edf2f7;
  color: #475569;
  text-align: left;
}

.fo-rank-bar {
  display: block;
  height: 6px;
  width: 84px;
  border-radius: 999px;
  background: #eef2f7;
}

.fo-rank-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fbbf24, #fb7185);
}

.fo-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fo-quick-grid button {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: #eef6ff;
  color: #1677ff;
  font-weight: 700;
  cursor: pointer;
}

.fo-quick-grid button:nth-child(2) { background: #ecfdf5; color: #0f9f6e; }
.fo-quick-grid button:nth-child(3) { background: #f5f3ff; color: #7c3aed; }
.fo-quick-grid button:nth-child(4) { background: #fff7ed; color: #ea580c; }

@media (max-width: 1200px) {
  .fo-kpi-grid,
  #page-flow-overview .fo-kpi-grid,
  .fo-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .fo-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .fo-kpi-grid,
  #page-flow-overview .fo-kpi-grid,
  .fo-bottom-grid {
    grid-template-columns: 1fr;
  }

  .fo-donut-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

.fc-flow-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.fc-flow-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 980px;
}

.fc-flow-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 10px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--muted) / 0.35);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.fc-flow-legend-title {
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-right: 4px;
}

.fc-flow-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fc-flow-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}

.fc-flow-legend-swatch[data-state='pass'] {
  background: #dcfce7;
  border-color: #86efac;
}

.fc-flow-legend-swatch[data-state='fail'] {
  background: #fee2e2;
  border-color: #fca5a5;
}

.fc-flow-legend-swatch[data-state='in_progress'] {
  background: #fef3c7;
  border-color: #fcd34d;
}

.fc-flow-legend-swatch[data-state='pending'] {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.fc-stage-box {
  min-width: 92px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  text-align: center;
  background: hsl(var(--card));
}

.fc-stage-box small {
  display: block;
  color: hsl(var(--muted-foreground));
  margin-top: 3px;
}

.fc-arrow {
  color: hsl(var(--muted-foreground));
  font-weight: 700;
}

.fc-check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 96px;
  align-items: center;
}

.fc-check-node {
  width: 74px;
  height: 74px;
  border: 1px solid hsl(var(--border));
  transform: rotate(45deg);
  display: grid;
  place-items: center;
  background: hsl(var(--muted));
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.fc-check-node-inner {
  transform: rotate(-45deg);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  font-weight: 600;
  max-width: 60px;
}

.fc-check-node[data-state='pass'] {
  color: #14532d;
  background: #dcfce7;
  border-color: #86efac;
}

.fc-check-node[data-state='fail'] {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fca5a5;
}

.fc-check-node[data-state='in_progress'] {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.fc-check-node[data-state='pending'] {
  color: #475569;
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
}

@media (max-width: 1024px) {
  .fc-flow-line {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    gap: 12px;
  }

  .fc-flow-line .fc-arrow {
    align-self: center;
    transform: rotate(90deg);
    line-height: 1;
  }

  .fc-check-group {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    min-width: 0;
  }
}

.fc-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.fc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.fc-field span {
  white-space: nowrap;
}

.fc-field input,
.fc-field select {
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 0;
  border: 1px solid #ddd;
  font-size: 13px;
}

.fc-field-grow {
  flex: 1 1 200px;
}

.fc-field-grow input {
  width: 100%;
}

.fc-toolbar-actions {
  display: flex;
  gap: 8px;
}

.fc-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 2px 0;
}

.fc-tag-section {
  padding: 14px 16px;
}

.fc-tag-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fc-tag-section-title {
  font-size: 13px;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.fc-tag-cloud {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-tag-cat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fc-tag-cat-label {
  font-size: 11px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  min-width: 36px;
}

.fc-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}

.fc-tag-pill--static {
  cursor: default;
}

.fc-tag-pill:hover:not(.fc-tag-pill--static) {
  transform: translateY(-1px);
}

.fc-tag-pill-active {
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.35);
}

.fc-tag-pill--green {
  background: hsl(142 76% 94%);
  color: hsl(142 76% 28%);
  border-color: hsl(142 76% 82%);
}

.fc-tag-pill--green_dark {
  background: hsl(152 55% 92%);
  color: hsl(152 55% 22%);
  border-color: hsl(152 45% 78%);
}

.fc-tag-pill--red {
  background: hsl(0 86% 96%);
  color: hsl(0 72% 40%);
  border-color: hsl(0 86% 88%);
}

.fc-tag-pill--purple {
  background: hsl(270 80% 96%);
  color: hsl(270 55% 35%);
  border-color: hsl(270 60% 88%);
}

.fc-tag-pill--orange {
  background: hsl(32 95% 94%);
  color: hsl(32 95% 28%);
  border-color: hsl(32 90% 82%);
}

.fc-tag-pill--blue {
  background: hsl(217 91% 96%);
  color: hsl(217 91% 38%);
  border-color: hsl(217 91% 85%);
}

.fc-tag-pill--gray {
  background: hsl(220 14% 96%);
  color: hsl(220 10% 38%);
  border-color: hsl(var(--border));
}

.fc-tag-pill--neutral {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

/* ========== 主数据 · 标签模板 ========== */
#page-mdm-tags {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.tagtpl-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tagtpl-hero,
.tagtpl-filter-panel,
.tagtpl-editor-card,
.tagtpl-list-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.tagtpl-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.tagtpl-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.tagtpl-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.tagtpl-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tagtpl-filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
}

.tagtpl-filter-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.tagtpl-filter-panel input,
.tagtpl-filter-panel select,
.tagtpl-create-grid input,
.tagtpl-create-grid select {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.tagtpl-filter-panel input:focus,
.tagtpl-filter-panel select:focus,
.tagtpl-create-grid input:focus,
.tagtpl-create-grid select:focus,
.tagtpl-json-editor:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.tagtpl-layout {
  display: grid;
  grid-template-columns: minmax(320px, .75fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: start;
}

.tagtpl-editor-card,
.tagtpl-list-card {
  padding: 16px;
}

.tagtpl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #172033;
  font-size: 14px;
}

.tagtpl-card-head p {
  margin: 4px 0 0;
  color: #7b8798;
  font-size: 12px;
  font-weight: 500;
}

.tagtpl-card-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.tagtpl-editor-card > p {
  margin: 0 0 12px;
  color: #7b8798;
  font-size: 12px;
}

.tagtpl-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 140px auto;
  gap: 10px;
  margin-bottom: 12px;
}

.tagtpl-json-editor {
  width: 100%;
  min-height: 300px;
  padding: 14px 16px;
  border: 1px solid #dfe7f1;
  border-radius: 10px;
  background: #fbfdff;
  color: #334155;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.tagtpl-tip {
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
}

.tagtpl-table-wrap {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  overflow: hidden;
}

.tagtpl-table {
  border-collapse: separate;
  border-spacing: 0;
}

.tagtpl-table thead th {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.tagtpl-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
}

.tagtpl-table tbody tr:hover td {
  background: #f8fbff;
}

.tagtpl-table .mono {
  color: #1d4ed8;
  font-weight: 700;
}

.tagtpl-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 14px;
  color: #64748b;
  font-size: 12px;
}

.tagtpl-pagination span:last-child {
  display: flex;
  gap: 8px;
}

@media (max-width: 1280px) {
  .tagtpl-layout {
    grid-template-columns: 1fr;
  }

  .tagtpl-create-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 760px) {
  .tagtpl-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .tagtpl-filter-panel,
  .tagtpl-create-grid {
    grid-template-columns: 1fr;
  }
}

.fc-task-table .fc-sub {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
}

.fc-ext-cell {
  max-width: 280px;
  vertical-align: top;
  font-size: 12px;
}

.fc-ext-order-rel {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed hsl(var(--border) / 0.9);
  font-size: 12px;
  line-height: 1.45;
  color: hsl(var(--foreground));
}

.fc-ext-cell > .fc-ext-order-rel:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.fc-ext-labels div {
  line-height: 1.45;
}

.fc-tags-cell {
  max-width: 220px;
  vertical-align: top;
}

.fc-update-cell {
  font-size: 12px;
  white-space: normal;
  max-width: 160px;
}

.fc-j-select {
  margin-top: 0;
  width: 100%;
  max-width: 140px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  border: 1px solid hsl(var(--border));
}

.fc-judgment-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: hsl(var(--muted));
}

.tpl-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.tpl-card-head h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.tpl-lane-select {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid hsl(var(--border));
  font-size: 12px;
  max-width: 180px;
}

/* --- 产品装配检验记录表（附图 DN-JL-QP-21-07 风格） --- */
.inspect-standard {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.inspect-assembly {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.assembly-sheet {
  padding-bottom: 24px;
}

.assembly-title-block {
  text-align: center;
  margin-bottom: 12px;
}

.asm-title-input {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 4px;
  font-size: 13px;
  border: none;
  background: transparent;
  text-align: center;
}

.asm-main-title {
  display: block;
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  border: none;
  background: transparent;
  text-align: center;
}

.assembly-doc-row {
  margin-top: 8px;
  font-size: 13px;
}

.assembly-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 16px;
  padding: 12px 14px !important;
  margin-bottom: 12px;
}

.assembly-meta-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.asm-input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  font-size: 13px;
  background: hsl(var(--card));
}

.assembly-hint {
  margin-bottom: 12px !important;
}

.assembly-section {
  margin-bottom: 16px;
  padding: 12px 14px !important;
}

.assembly-sec-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.assembly-sec-tag {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--accent-foreground));
  background: hsl(var(--accent));
  padding: 4px 10px;
  border-radius: 8px;
}

.assembly-scroll {
  overflow-x: auto;
  margin: 0 -6px;
  padding: 0 6px;
}

.assembly-grid {
  min-width: 920px;
  font-size: 12px;
}

.asm-th-sub {
  font-weight: 400;
  font-size: 10px;
  color: hsl(var(--muted-foreground));
}

.asm-cell-req {
  min-width: 140px;
  vertical-align: top;
}

.asm-row-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.asm-input-sm {
  width: 100%;
  margin-bottom: 4px;
  font-size: 11px !important;
  padding: 4px 6px !important;
}

.asm-qual {
  width: 100%;
  max-width: 88px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid hsl(var(--border));
  font-size: 11px;
}

.asm-dim {
  width: 72px;
  max-width: 100%;
  font-size: 11px !important;
  padding: 4px 6px !important;
}

.assembly-conclusion {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed hsl(var(--border));
}

.assembly-conc-label {
  font-size: 13px;
  font-weight: 600;
}

.assembly-conc-val {
  font-size: 14px;
}

/* 产品出厂检测报告 OQC */
.batch-release-sheet {
  padding-bottom: 24px;
}

.br-bilingual-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 640px;
  margin: 0 auto;
}

.br-title-en {
  font-size: 14px !important;
  font-weight: 600 !important;
}

.br-meta-top .br-conclusion-readout {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  font-size: 14px;
  color: hsl(var(--foreground));
}

.br-sampling-block {
  padding: 12px 14px !important;
  margin-bottom: 12px;
}

.br-sampling-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 8px;
}

.br-sampling-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  min-width: 160px;
  flex: 1;
}

.br-aql-input {
  min-width: 200px;
}

/* ========== 主数据 · 抽样方案 ========== */
#page-mdm-sampling {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.sampling-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sampling-hero,
.sampling-filter-panel,
.sampling-kpi,
.sampling-create-panel,
.sampling-transfer-card,
.sampling-policy-details,
.sampling-table-wrap {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.sampling-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.sampling-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.sampling-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.sampling-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sampling-filter-panel {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
}

.sampling-filter-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.sampling-filter-panel input,
.sampling-filter-panel select,
.sampling-create-panel input {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.sampling-filter-panel input:focus,
.sampling-filter-panel select:focus,
.sampling-create-panel input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.sampling-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.sampling-kpi {
  position: relative;
  min-height: 104px;
  padding: 18px 18px 16px 64px;
}

.sampling-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--sampling-kpi-bg, #eef6ff);
}

.sampling-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sampling-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.sampling-kpi span,
.sampling-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.sampling-kpi strong {
  display: block;
  margin: 10px 0 6px;
  color: #172033;
  font-size: 28px;
  line-height: 1;
}

.sampling-kpi-blue { --sampling-kpi-color: #1677ff; --sampling-kpi-bg: #e8f3ff; }
.sampling-kpi-green { --sampling-kpi-color: #16a34a; --sampling-kpi-bg: #ecfdf3; }
.sampling-kpi-orange { --sampling-kpi-color: #f59e0b; --sampling-kpi-bg: #fff7e6; }
.sampling-kpi-red { --sampling-kpi-color: #ef4444; --sampling-kpi-bg: #fff1f2; }

.sampling-create-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(110px, 0.8fr) minmax(180px, 1.4fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.sampling-create-panel select {
  height: 38px;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  padding: 0 10px;
  background: #f8fbff;
  color: #172033;
}

.sampling-create-panel input:disabled {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
}

.sampling-transfer-card {
  padding: 16px;
}

.sampling-transfer-card .iqc-form-section-title {
  margin-bottom: 12px;
  color: #172033;
}

.sampling-table-wrap {
  overflow: hidden;
  padding: 0;
}

.sampling-table {
  border-collapse: separate;
  border-spacing: 0;
}

.sampling-table thead th {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.sampling-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
}

.sampling-table tbody tr:hover td {
  background: #f8fbff;
}

.sampling-table .mono {
  color: #1d4ed8;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .sampling-filter-panel {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .sampling-kpi-grid,
  .sampling-create-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .sampling-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .sampling-filter-panel,
  .sampling-kpi-grid,
  .sampling-create-panel {
    grid-template-columns: 1fr;
  }
}

.br-main-table {
  min-width: 720px;
  font-size: 12px;
}

.br-col-no {
  width: 40px;
}

.br-col-item {
  min-width: 100px;
  max-width: 120px;
}

.br-col-req {
  min-width: 200px;
  max-width: 280px;
  vertical-align: top;
}

.br-col-sample {
  width: 84px;
}

.br-tech-area {
  width: 100%;
  resize: vertical;
  min-height: 36px;
  font-size: 11px !important;
}

.br-qual-tech {
  font-size: 10px;
  line-height: 1.35;
  color: hsl(var(--muted-foreground));
  max-height: 120px;
  overflow: auto;
}

.br-dim {
  width: 72px;
  max-width: 100%;
  font-size: 11px !important;
  padding: 4px 6px !important;
}

.br-failed-block {
  margin-top: 14px;
  padding: 12px 14px !important;
}

.br-failed-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 13px;
}

.br-fail-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  width: 100%;
}

.br-fail-line .asm-input {
  flex: 1;
}

.br-fail-idx {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  min-width: 1.2em;
}

.br-sign-row {
  margin-top: 12px;
}

.pm-doc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pm-page-of {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pm-page-inp {
  width: 3.5em !important;
  text-align: center;
  display: inline-block;
}

.pm-table .pm-cell {
  font-size: 12px;
}

.pm-col-narrow {
  max-width: 88px;
}

.pm-col-idx {
  width: 44px;
}

.pm-footer-block {
  margin-top: 12px;
  padding: 12px 14px !important;
}

.pm-summary {
  width: 100%;
  margin-top: 6px;
}

.pm-footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 10px;
  align-items: flex-end;
}

.mc-doc-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
  align-items: center;
}

.mc-date-right {
  font-size: 12px;
}

.machining-section {
  margin-bottom: 14px;
}

.machining-grid {
  min-width: 960px;
}

.mc-dim {
  width: 64px;
  max-width: 100%;
  font-size: 11px !important;
  padding: 4px 4px !important;
}

.electro-table {
  min-width: 1060px;
}

.electro-table .el-cell-ta {
  width: 100%;
  min-width: 120px;
  resize: vertical;
  font-size: 11px;
}

@media (max-width: 1024px) {
  .fc-layout {
    flex-direction: column;
  }

  .fc-tree {
    width: 100%;
  }
}

/* ========== 智能品质中枢壳层（layout-pro）深蓝顶栏 + 浅灰侧栏 + 卡片主区（Ant Design 系） ========== */
body.layout-pro {
  font-optical-sizing: auto;
  line-height: 1.5715;
  --erp-topnav: #0958d9;
  --erp-topnav-hover: #1677ff;
  --erp-topnav-text: #fff;
  --pro-sidebar-bg: #fafafa;
  --pro-sidebar-sub: #8c8c8c;
  --pro-sidebar-hover: #f0f0f0;
  --pro-sidebar-active-tint: #e6f4ff;
  --pro-main-bg: #fff;
  --pro-text-strong: #262626;
  --pro-border: #d9d9d9;
  --pro-border-soft: #f0f0f0;
  --primary: 212 100% 50%;
  --primary-soft: 212 100% 97%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.layout-pro .erp-topnav {
  height: 40px;
  padding: 0 14px;
  background: linear-gradient(180deg, #1677ff 0%, #0958d9 100%);
  border-bottom: 1px solid #003a8c;
  box-shadow: 0 1px 4px rgb(0 55 107 / 0.18);
}

body.layout-pro .sidebar {
  width: 240px;
  height: 100%;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  background: var(--pro-sidebar-bg);
  border-right: 1px solid var(--pro-border-soft);
  box-shadow: none;
}

body.layout-pro .sidebar-brand {
  padding: 12px 14px;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--pro-border-soft);
}

body.layout-pro .brand-mark {
  background: linear-gradient(145deg, #1677ff, #0958d9);
  border: none;
}

body.layout-pro .brand-text {
  color: var(--pro-text-strong);
}

body.layout-pro .brand-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--pro-sidebar-sub);
  text-shadow: none;
}

body.layout-pro .sidebar-search-wrap {
  background: var(--pro-sidebar-bg);
  padding: 8px 10px 10px;
}

body.layout-pro .sidebar-search-label {
  background: #fff;
  border: 1px solid var(--pro-border);
  border-radius: 6px;
}

body.layout-pro .sidebar-search-label:focus-within {
  border-color: #1677ff;
  outline: none;
  box-shadow: 0 0 0 2px rgb(22 119 255 / 0.2);
}

body.layout-pro .sidebar-search-input {
  color: var(--pro-text-strong);
}

body.layout-pro .sidebar-search-input::placeholder {
  color: #bfbfbf;
}

body.layout-pro .sidebar-search-icon {
  color: var(--pro-sidebar-sub);
}

body.layout-pro .sidebar-search-kbd {
  display: none;
}

body.layout-pro .nav-section {
  border-bottom: 1px solid var(--pro-border-soft);
}

body.layout-pro .nav-section-toggle {
  color: var(--pro-text-strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 11px 10px 9px;
}

body.layout-pro .nav-section-toggle:hover {
  color: #1677ff;
  background: rgb(0 0 0 / 0.03);
}

body.layout-pro .nav-section-toggle-icon {
  color: #1677ff;
  background: #e6f4ff;
  border-radius: 6px;
  border: 1px solid rgb(22 119 255 / 0.15);
}

body.layout-pro .nav-section-toggle:hover .nav-section-toggle-icon {
  color: #0958d9;
  background: #bae0ff;
  border-color: rgb(22 119 255 / 0.28);
}

body.layout-pro .nav-section-toggle-chevron {
  border-top-color: #8c8c8c;
}

body.layout-pro .nav-section-body {
  padding-bottom: 8px;
  border-left: 2px solid #f0f0f0;
  margin-left: 10px;
  padding-left: 4px;
}

body.layout-pro .nav-section-body .nav-item {
  padding-left: 8px;
}

body.layout-pro .sidebar-nav .nav-item {
  color: #434343;
  border-radius: 6px;
  grid-template-columns: 18px minmax(0, 1fr);
}

body.layout-pro .sidebar-nav .nav-item:hover {
  color: var(--pro-text-strong);
  background: var(--pro-sidebar-hover);
}

body.layout-pro .sidebar-nav .nav-item:hover .nav-item-icon {
  color: #1677ff;
}

body.layout-pro .sidebar-nav .nav-item.active {
  color: #1677ff;
  background: var(--pro-sidebar-active-tint);
  font-weight: 600;
}

body.layout-pro .sidebar-nav .nav-item.active::before {
  display: block;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1677ff;
}

body.layout-pro .sidebar-nav .nav-item.active .nav-item-icon {
  color: #1677ff;
}

body.layout-pro .sidebar-profile,
body.layout-pro .sidebar-auth-panel {
  background: #fafafa;
  border: 1px solid var(--pro-border-soft);
  border-radius: 6px;
  color: var(--pro-text-strong);
}

body.layout-pro .sidebar-profile-name {
  color: var(--pro-text-strong);
}

body.layout-pro .sidebar-profile-account {
  color: var(--pro-sidebar-sub);
}

body.layout-pro .sidebar-profile-avatar {
  background: linear-gradient(145deg, #1677ff, #0958d9);
  border: none;
}

body.layout-pro .user-label {
  color: #8c8c8c;
}

/* 侧栏底部 · Sidebar Quick Access Card */
body.layout-pro .sidebar-footer {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 12px 12px 14px;
  border: none;
  border-top: 1px solid var(--pro-border-soft);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  gap: 8px;
}

body.layout-pro .sidebar-tools {
  gap: 8px;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

body.layout-pro .sidebar-tool-btn {
  border-color: var(--pro-border-soft);
  border-radius: 6px;
  background: #fff;
  color: #595959;
}

body.layout-pro .sidebar-tool-btn:hover {
  background: #f0f5ff;
  border-color: #91caff;
  color: #1677ff;
}

body.layout-pro .sidebar-caliper-btn {
  border-color: var(--pro-border-soft);
  border-radius: 6px;
  background: #fff;
  color: #595959;
}

body.layout-pro .sidebar-caliper-btn:hover {
  background: #f0f5ff;
  border-color: #91caff;
  color: #1677ff;
}

body.layout-pro .sidebar-global-scan {
  border-color: var(--pro-border-soft);
  border-radius: 6px;
}

body.layout-pro .sidebar-version {
  color: #bfbfbf;
}

body.layout-pro .sidebar-footer-toggle {
  height: auto;
  min-height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 8px 4px;
}

body.layout-pro .sidebar-footer-toggle:hover {
  border: none;
  background: #f9fafb;
  color: #2563eb;
}

body.layout-pro .sidebar-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 2px 8px;
}

body.layout-pro .sidebar-quick-head span {
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.layout-pro .sidebar-quick-head strong {
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 950;
}

body.layout-pro .sidebar-footer.is-collapsed .sidebar-quick-head {
  display: none;
}

body.layout-pro .sidebar-profile {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgb(226 235 247 / 0.9);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.78);
}

body.layout-pro .sidebar-profile-avatar {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  box-shadow: 0 8px 18px rgb(47 125 255 / 0.24);
}

body.layout-pro .sidebar-profile-name {
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 950;
}

body.layout-pro .sidebar-profile-account {
  color: var(--ai-sub);
  font-size: 10px;
  font-weight: 750;
}

body.layout-pro .sidebar-auth-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgb(226 235 247 / 0.9);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.78);
}

body.layout-pro .sidebar-auth-actions {
  gap: 8px;
  margin-bottom: 8px;
}

body.layout-pro .sidebar-auth-actions .btn {
  min-height: 28px;
  border-radius: 999px;
  font-weight: 850;
}

body.layout-pro .user-label {
  margin: 2px 0 5px;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.layout-pro #current-user {
  width: 100%;
  min-height: 32px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #f8fbff);
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 750;
}

body.layout-pro #current-user {
  background: #fff;
  border-color: var(--pro-border);
  color: var(--pro-text-strong);
  border-radius: 6px;
}

body.layout-pro .sidebar-auth-actions .btn-ghost {
  background: #fff;
  border: 1px solid var(--pro-border);
  color: #595959;
  border-radius: 6px;
}

body.layout-pro .app-main {
  background: var(--pro-main-bg);
}

body.layout-pro .erp-main-chrome {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--pro-border-soft);
  border-bottom: 1px solid var(--pro-border);
  padding: 0 12px;
  margin: 12px 16px 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

body.layout-pro .erp-nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 0;
}

body.layout-pro .erp-back-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--pro-border-soft);
  border-radius: 8px;
  background: #fafafa;
  color: #595959;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

body.layout-pro .erp-back-btn:hover {
  background: #f0f5ff;
  border-color: rgb(47 125 255 / 0.25);
  color: #1677ff;
}

body.layout-pro .erp-nav-title {
  flex: 1;
  min-width: 0;
}

body.layout-pro .erp-nav-current {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--pro-text-strong);
}

body.layout-pro .erp-refresh-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  margin: 4px 8px 4px 0;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  color: #595959;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

body.layout-pro .erp-refresh-btn:hover {
  color: #1677ff;
  border-color: #1677ff;
}

body.layout-pro .app-page-head {
  background: #fff;
  margin: 0 16px;
  padding: 14px 16px 10px;
  border: 1px solid var(--pro-border-soft);
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  box-shadow: none;
}

body.layout-pro.erp-local-title-page .app-page-head {
  display: none;
}

body.layout-pro:has(#page-entry:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-create-task:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-task-query:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-dashboard:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-flow-overview:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-order-flow:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-oqc-sn:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-templates:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-products:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-product-edit:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-mdm-params:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-inspection-rules:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-ai-review:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-mdm-sampling:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-mdm-tags:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-mdm-product-categories:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-mdm-partners:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-mdm-status:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-instruments:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-msa:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-cal-reminders:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-auto-rules:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-kanbans:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-users-admin:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-kingdee-sync:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-offline-import:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-test-center:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-product-field-config:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-stats-cpk:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-stats-merge:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-my-tasks:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-completed:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-iqc-batches:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-mdm-exemptions:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-sales-orders:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-qc-trace:not(.hidden)) .app-page-head,
body.layout-pro:has(#page-module-home:not(.hidden)) .app-page-head {
  display: none;
}

body.layout-pro.erp-local-title-page .app-page-toolbar {
  border-top: none;
  border-radius: 0 0 8px 8px;
}

body.layout-pro:has(#page-entry:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-create-task:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-task-query:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-dashboard:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-flow-overview:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-order-flow:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-oqc-sn:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-templates:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-products:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-product-edit:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-mdm-params:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-inspection-rules:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-ai-review:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-mdm-sampling:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-mdm-tags:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-mdm-product-categories:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-mdm-partners:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-mdm-status:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-instruments:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-msa:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-cal-reminders:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-auto-rules:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-kanbans:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-users-admin:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-kingdee-sync:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-offline-import:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-stats-cpk:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-stats-merge:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-my-tasks:not(.hidden)) .app-page-toolbar,
body.layout-pro:has(#page-completed:not(.hidden)) .app-page-toolbar {
  border-top: none;
  border-radius: 0 0 8px 8px;
}

body.layout-pro .app-page-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.layout-pro .app-page-head-icon {
  color: #1677ff;
}

body.layout-pro .app-page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--pro-text-strong);
  letter-spacing: -0.02em;
}

body.layout-pro .app-page-divider {
  display: none;
}

body.layout-pro .app-page-desc {
  margin: 6px 0 0;
  padding: 0 0 2px;
  font-size: 13px;
  color: #8c8c8c;
  font-weight: 400;
  line-height: 1.55;
  border-bottom: none;
}

body.layout-pro .app-page-toolbar {
  margin: 0 16px 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--pro-border-soft);
  border-top: none;
  border-bottom: 1px solid var(--pro-border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

body.layout-pro .app-content {
  background: transparent;
  padding: 12px 16px 24px;
  color: var(--pro-text-strong);
  font-size: 14px;
}

body.layout-pro .data-table {
  border: 1px solid var(--pro-border);
}

body.layout-pro .table-wrap .data-table {
  border: none;
}

body.layout-pro .data-table th,
body.layout-pro .data-table td {
  border-bottom: 1px solid var(--pro-border-soft);
}

body.layout-pro .data-table th {
  background: #fafafa;
  color: var(--pro-text-strong);
  font-weight: 700;
  font-size: 13px;
  border-bottom: 2px solid var(--pro-border);
}

body.layout-pro .data-table td {
  color: var(--pro-text-strong);
  font-weight: 500;
  font-size: 13px;
}

body.layout-pro .data-table tbody tr:nth-child(even) td {
  background: #fafafa;
}

body.layout-pro .data-table tbody tr:hover td {
  background: #e6f4ff !important;
}

body.layout-pro .card {
  border-radius: 8px;
  border: 1px solid var(--pro-border-soft);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

body.layout-pro .table-wrap {
  border-radius: 8px;
  border: 1px solid var(--pro-border-soft);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

body.layout-pro .ins-sidebar {
  border-radius: 8px;
}

body.layout-pro .btn {
  border-radius: 6px;
}

body.layout-pro .btn-primary {
  background: var(--qcos-blue, #2563eb);
  border-color: var(--qcos-blue-hover, #1d4ed8);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.02);
}

body.layout-pro .btn-primary:hover {
  filter: brightness(1.06);
}

body.layout-pro .btn-ghost {
  background: #fff;
  color: #595959;
  border-color: #d9d9d9;
}

body.layout-pro .btn-ghost:hover {
  color: #1677ff;
  border-color: #1677ff;
  background: #fff;
}

body.layout-pro .task-bar,
body.layout-pro .inspect-tabs,
body.layout-pro .inspect-content {
  border-radius: 8px;
  border-color: var(--pro-border-soft);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

body.layout-pro .task-bar-tag {
  border-radius: 4px;
  background: #f5f5f5;
  border-color: #f0f0f0;
  color: #595959;
}

body.layout-pro .topbar-date-input,
body.layout-pro .topbar-icon-btn,
body.layout-pro .global-scan,
body.layout-pro #current-user {
  border-radius: 6px;
}

body.layout-pro .status-pill {
  border-radius: 4px;
  font-weight: 600;
}

body.layout-pro .modal-content {
  border-radius: 8px;
  border-color: var(--pro-border-soft);
}

body.layout-pro .kpi,
body.layout-pro .task-card {
  border-radius: 8px;
  border-color: var(--pro-border-soft);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

body.layout-pro .form-grid input,
body.layout-pro .form-grid select,
body.layout-pro .form-row input,
body.layout-pro .form-row select,
body.layout-pro .filter-row input,
body.layout-pro .filter-row select,
body.layout-pro .iqc-toolbar-card input,
body.layout-pro .iqc-toolbar-card select {
  border-radius: 6px;
  border-color: #d9d9d9;
}

body.layout-pro .ins-cat-btn-active {
  background: #e6f4ff;
  color: #1677ff;
  border: 1px solid #91caff;
}

body.layout-pro .hint {
  color: #595959;
  font-weight: 500;
  border-color: var(--pro-border-soft);
  background: #fafafa;
}

body.layout-pro .filter-row .filter-label,
body.layout-pro .form-grid label {
  color: var(--pro-text-strong);
  font-weight: 600;
}

/* 侧栏收起 */
body.layout-pro.sidebar-collapsed .sidebar {
  width: 64px;
}

body.layout-pro.sidebar-collapsed .brand-copy,
body.layout-pro.sidebar-collapsed .brand-mark,
body.layout-pro.sidebar-collapsed .sidebar-search-wrap,
body.layout-pro.sidebar-collapsed .sidebar-search-kbd,
body.layout-pro.sidebar-collapsed .sidebar-menu-prefs-btn,
body.layout-pro.sidebar-collapsed .nav-item-text,
body.layout-pro.sidebar-collapsed .nav-section-toggle {
  display: none !important;
}

body.layout-pro.sidebar-collapsed .nav-section-body {
  display: block !important;
  border: none;
  margin: 0;
  padding: 0 4px;
}

body.layout-pro.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}

body.layout-pro.sidebar-collapsed .sidebar-nav {
  padding-left: 6px;
  padding-right: 6px;
}

body.layout-pro.sidebar-collapsed .sidebar-nav .nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  padding-left: 4px;
  padding-right: 4px;
}

body.layout-pro.sidebar-collapsed .sidebar-nav .nav-item-icon {
  width: 20px;
  height: 20px;
}

body.layout-pro.sidebar-collapsed .sidebar-tools-scan,
body.layout-pro.sidebar-collapsed .sidebar-caliper-label,
body.layout-pro.sidebar-collapsed .sidebar-version {
  display: none !important;
}

body.layout-pro.sidebar-collapsed .sidebar-tools-icons {
  flex-direction: column;
  gap: 4px;
}

body.layout-pro.sidebar-collapsed .sidebar-caliper-btn {
  justify-content: center;
  padding: 6px;
}

body.layout-pro.sidebar-collapsed .sidebar-tools {
  margin-bottom: 6px;
  padding-bottom: 6px;
}

body.layout-pro.sidebar-collapsed .sidebar-footer-toggle {
  font-size: 0;
  padding: 8px;
  position: relative;
}

body.layout-pro.sidebar-collapsed .sidebar-footer-toggle::after {
  content: '⋯';
  font-size: 16px;
  line-height: 1;
  color: #595959;
}

body.layout-pro.sidebar-collapsed .sidebar-profile,
body.layout-pro.sidebar-collapsed .sidebar-auth-panel {
  display: none;
}

body.layout-pro.sidebar-collapsed .sidebar-footer.is-collapsed .sidebar-profile,
body.layout-pro.sidebar-collapsed .sidebar-footer.is-collapsed .sidebar-auth-panel {
  display: none;
}

/* ========== 看板管理：工具条、行入场、开关、刷新旋转、全屏预览动效 ========== */
.kb-admin-card {
  margin-bottom: 12px;
}

.kb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}

.kb-filter-input {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  padding: 7px 10px;
  border: 1px solid #d9d9d9;
  font-size: 13px;
}

.kb-auto-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #595959;
  cursor: pointer;
  user-select: none;
}

.kb-refresh-btn.is-spinning .kb-refresh-icon {
  display: inline-block;
  animation: kbSpin 0.7s linear infinite;
}

@keyframes kbSpin {
  to {
    transform: rotate(360deg);
  }
}

.kb-refresh-icon {
  vertical-align: -2px;
  margin-right: 4px;
}

.kb-add-row {
  margin: 0;
}

.kb-table-wrap {
  margin-bottom: 8px;
}

.kb-row-anim {
  animation: kbRowIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--kb-i, 0) * 42ms);
}

@keyframes kbRowIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kb-code {
  font-family: var(--mono);
  font-size: 12px;
}

.kb-url-cell a {
  font-size: 12px;
  word-break: break-all;
}

.kb-time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #595959;
  font-size: 12px;
}

.kb-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: #595959;
}

.kb-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #bfbfbf;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.kb-switch.is-on .kb-switch-track {
  background: #52c41a;
}

.kb-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.kb-switch.is-on .kb-switch-knob {
  transform: translateX(18px);
}

.kb-switch-txt {
  min-width: 2em;
  text-align: left;
}

.kb-empty-hint {
  margin-top: 4px;
}

/* 看板管理 · Kanban Management Command Center */
#page-kanbans {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-kanbans .kb-command-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  align-items: stretch;
  box-sizing: border-box;
}

#page-kanbans .kb-hero,
#page-kanbans .kb-admin-card,
#page-kanbans .kb-registry-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-kanbans .kb-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-kanbans .kb-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-kanbans .kb-hero > * {
  position: relative;
  z-index: 1;
}

#page-kanbans .kb-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-kanbans .kb-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-kanbans .kb-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-kanbans .kb-hero p:not(.kb-hero-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-kanbans .kb-hero-tags,
#page-kanbans .kb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-kanbans .kb-hero-tags {
  margin-top: 14px;
}

#page-kanbans .kb-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-kanbans .kb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

#page-kanbans .kb-kpi:not(.is-active):not(.kpi-stat-only) {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-kanbans .kb-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--kb-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-kanbans .kb-kpi-blue { --kb-kpi-color: #1677ff; }
#page-kanbans .kb-kpi-green { --kb-kpi-color: #22c55e; }
#page-kanbans .kb-kpi-cyan { --kb-kpi-color: #06b6d4; }
#page-kanbans .kb-kpi-red { --kb-kpi-color: #ef4444; }

#page-kanbans .kb-kpi span,
#page-kanbans .kb-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-kanbans .kb-kpi strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-kanbans .kb-admin-card {
  overflow: hidden;
  margin-bottom: 0;
  padding: 0 !important;
}

#page-kanbans .kb-control-console,
#page-kanbans .kb-registration-console {
  padding: 18px !important;
}

#page-kanbans .kb-control-console {
  border-bottom: 1px solid #edf3fb;
}

#page-kanbans .kb-control-console::before,
#page-kanbans .kb-registration-console::before {
  content: none !important;
  display: none !important;
}

#page-kanbans .kb-console-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-kanbans .kb-console-head strong,
#page-kanbans .kb-registry-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-kanbans .kb-console-head p,
#page-kanbans .kb-registry-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-kanbans .kb-filter-input,
#page-kanbans .kb-add-row input {
  height: 38px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-kanbans .kb-registry-panel {
  overflow: hidden;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

#page-kanbans .kb-registry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf3fb;
}

#page-kanbans .kb-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}

#page-kanbans .kb-table thead th {
  background: #f6faff;
  color: #5b6b84;
  font-size: 12px;
  font-weight: 900;
}

#page-kanbans .kb-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-kanbans .kb-table tbody tr:hover td {
  background: #f8fbff;
}

#page-kanbans .kb-empty-hint {
  margin: 0;
  padding: 14px 18px 18px;
  text-align: center;
}

#page-kanbans .kb-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-kanbans .kb-empty-cell strong,
#page-kanbans .kb-empty-cell span {
  display: block;
}

#page-kanbans .kb-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-kanbans .kb-hero,
  #page-kanbans .kb-registry-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #page-kanbans .kb-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* 用户管理 · User Access Command Center */
#page-users-admin {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-users-admin .ua-command-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  align-items: stretch;
  box-sizing: border-box;
}

#page-users-admin .ua-hero,
#page-users-admin .ua-provision-console,
#page-users-admin .ua-registry-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-users-admin .ua-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-users-admin .ua-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-users-admin .ua-hero > * {
  position: relative;
  z-index: 1;
}

#page-users-admin .ua-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-users-admin .ua-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-users-admin .ua-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-users-admin .ua-hero p:not(.ua-hero-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-users-admin .ua-hero-tags,
#page-users-admin .ua-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-users-admin .ua-hero-tags {
  margin-top: 14px;
}

#page-users-admin .ua-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-users-admin .ua-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

#page-users-admin .ua-kpi {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-users-admin .ua-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--ua-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-users-admin .ua-kpi-purple { --ua-kpi-color: #8b5cf6; }
#page-users-admin .ua-kpi-green { --ua-kpi-color: #22c55e; }
#page-users-admin .ua-kpi-red { --ua-kpi-color: #ef4444; }

#page-users-admin .ua-kpi span,
#page-users-admin .ua-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-users-admin .ua-kpi strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-users-admin .ua-hint {
  margin: 0;
  padding: 0 4px;
}

#page-users-admin .ua-provision-console {
  align-items: center;
  padding: 18px !important;
}

#page-users-admin .ua-provision-console::before {
  content: none !important;
  display: none !important;
}

#page-users-admin .ua-console-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-users-admin .ua-console-head strong,
#page-users-admin .ua-registry-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-users-admin .ua-console-head p,
#page-users-admin .ua-registry-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-users-admin .ua-provision-console input,
#page-users-admin .ua-provision-console select {
  height: 38px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-users-admin .ua-registry-panel {
  overflow: hidden;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

#page-users-admin .ua-registry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf3fb;
}

#page-users-admin .ua-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#page-users-admin .ua-table thead th {
  background: #f6faff;
  color: #5b6b84;
  font-size: 12px;
  font-weight: 900;
}

#page-users-admin .ua-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-users-admin .ua-table tbody tr:hover td {
  background: #f8fbff;
}

#page-users-admin .ua-username {
  color: var(--ai-text);
  font-weight: 950;
}

#page-users-admin .ua-status,
#page-users-admin .ua-login {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

#page-users-admin .ua-status-active,
#page-users-admin .ua-login-ok {
  background: #e8fff2;
  color: #16a34a;
}

#page-users-admin .ua-status-disabled,
#page-users-admin .ua-login-no {
  background: #f1f5f9;
  color: #64748b;
}

#page-users-admin .ua-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-users-admin .ua-empty-cell strong,
#page-users-admin .ua-empty-cell span {
  display: block;
}

#page-users-admin .ua-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-users-admin .ua-hero,
  #page-users-admin .ua-registry-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #page-users-admin .ua-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* 全屏预览：大屏深色壳 + 扫光 + 呼吸点 + 实时时钟 */
.kb-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.kb-preview-modal.hidden {
  display: none !important;
}

.kb-preview-bg {
  position: absolute;
  inset: 0;
  background: rgb(0 12 32 / 0.72);
  backdrop-filter: blur(4px);
}

.kb-preview-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100vw - 24px, 1280px);
  height: min(100vh - 24px, 900px);
  margin: auto;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(160deg, #0a1628 0%, #0d2137 45%, #0a1628 100%);
  box-shadow:
    0 0 0 1px rgb(64 169 255 / 0.35),
    0 0 40px rgb(22 119 255 / 0.2),
    0 24px 80px rgb(0 0 0 / 0.45);
  animation: kbShellIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes kbShellIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.kb-preview-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgb(64 169 255 / 0.9), transparent);
  animation: kbScan 3.5s linear infinite;
  pointer-events: none;
  z-index: 4;
}

@keyframes kbScan {
  0% {
    transform: translateX(-100%);
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0.3;
  }
}

.kb-preview-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgb(64 169 255 / 0.25);
  background: linear-gradient(180deg, rgb(15 40 70 / 0.95), rgb(10 28 48 / 0.88));
}

.kb-preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.kb-preview-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52c41a;
  box-shadow: 0 0 0 0 rgb(82 196 26 / 0.55);
  animation: kbPulse 2s ease-out infinite;
}

@keyframes kbPulse {
  0% {
    box-shadow: 0 0 0 0 rgb(82 196 26 / 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgb(82 196 26 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(82 196 26 / 0);
  }
}

.kb-preview-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #e6f4ff;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-preview-clock {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgb(186 220 255 / 0.95);
  white-space: nowrap;
}

.kb-preview-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 4px;
  background: rgb(255 255 255 / 0.06);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.kb-preview-close:hover {
  background: rgb(255 77 79 / 0.25);
  border-color: rgb(255 120 122 / 0.5);
}

.kb-preview-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #020810;
}

.kb-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.kb-preview-foot {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  color: rgb(186 220 255 / 0.75);
  border-top: 1px solid rgb(64 169 255 / 0.2);
  background: rgb(5 20 40 / 0.9);
}

.kb-preview-foot a {
  color: #69b1ff;
  font-weight: 600;
  margin-left: 4px;
}

.kb-preview-foot a:hover {
  color: #bae0ff;
}

/* ---- 统计分析（工序能力 / 合并汇总）---- */
.cell-muted {
  color: #8c8c8c;
  text-align: center;
  padding: 14px 10px;
  font-size: 13px;
}

.stats-page-toolbar {
  margin-bottom: 12px;
  padding: 10px 14px;
}

.stats-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stats-split {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 12px;
  align-items: start;
}

.stats-split-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-side-card {
  padding: 0;
  overflow: hidden;
}

.stats-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  font-weight: 600;
}

.stats-side-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.stats-param-filter {
  flex: 1;
  min-width: 80px;
  max-width: 140px;
  padding: 4px 8px;
  border: 1px solid #d9d9d9;
  font-size: 12px;
}

.stats-split-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.stats-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 16px;
  padding: 12px 14px;
}

.stats-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.stats-kv span {
  color: #8c8c8c;
}

.stats-kv em {
  font-style: normal;
  font-weight: 600;
  color: #262626;
}

.stats-summary-placeholder {
  padding: 20px 16px;
  min-height: 120px;
}

.stats-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats-chart-slot {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.stats-merge-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.stats-merge-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
}

.stats-merge-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.stats-merge-check input {
  width: auto;
  margin: 0;
}

.stats-merge-split {
  grid-template-columns: minmax(260px, 320px) 1fr;
}

.stats-merge-pending {
  padding: 0;
  overflow: hidden;
}

.stats-pending-tag {
  display: inline-block;
  margin: 8px 12px 0;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #fa8c16;
  border-radius: 2px;
}

.stats-merge-pending .table-wrap {
  padding: 0 0 8px;
}

.stats-merge-body {
  min-height: 280px;
  padding: 20px 16px;
}

@media (max-width: 960px) {
  .stats-split,
  .stats-merge-split {
    grid-template-columns: 1fr;
  }

  .stats-charts-row {
    grid-template-columns: 1fr;
  }
}

/* ---- 销售订单台账 · 订单详情抽屉 ---- */
#page-sales-orders .of-order-link {
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #175cd3;
  font: inherit;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

#page-sales-orders .of-order-link:hover { text-decoration: underline; }

.sor-detail-backdrop {
  position: fixed;
  z-index: 5000;
  inset: 0;
  background: rgb(15 23 42 / .34);
  backdrop-filter: blur(2px);
}

.sor-detail-backdrop.hidden { display: none; }

.sor-detail-drawer {
  position: fixed;
  z-index: 5001;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(860px, 96vw);
  height: 100dvh;
  background: #f7f9fc;
  box-shadow: -20px 0 60px rgb(15 23 42 / .18);
}

.sor-detail-drawer.hidden { display: none; }

.sor-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #e5eaf2;
  background: #fff;
}

.sor-detail-head-main {
  min-width: 0;
}

.sor-detail-eyebrow {
  display: block;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.sor-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 2px;
}

.sor-detail-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  word-break: break-all;
}

.sor-detail-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  background: #f1f5f9;
  color: #475569;
}

.sor-detail-status-pill.is-ok {
  background: #ecfdf5;
  color: #047857;
}

.sor-detail-status-pill.is-warn {
  background: #fff7ed;
  color: #c2410c;
}

.sor-detail-status-pill.is-danger {
  background: #fef2f2;
  color: #b91c1c;
}

.sor-detail-status-pill.is-neutral {
  background: #eff6ff;
  color: #1d4ed8;
}

.sor-detail-status-pill.hidden {
  display: none !important;
}

.sor-detail-close {
  width: 32px;
  height: 32px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sor-detail-close:hover { color: #0f172a; background: #f1f5f9; }

.sor-detail-body {
  flex: 1;
  overflow: auto;
  padding: 14px 20px 20px;
  background: #f7f9fc;
}

.sor-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 12px 14px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
}

.sor-detail-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0 12px;
  border-left: 1px solid #eef2f6;
}

.sor-detail-summary-item:first-child {
  border-left: 0;
  padding-left: 0;
}

.sor-detail-summary-item:last-child {
  padding-right: 0;
}

.sor-detail-summary-item em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.sor-detail-summary-item strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.sor-detail-more,
.sor-detail-notes-block {
  margin-top: 10px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
}

.sor-detail-more > summary,
.sor-detail-notes-block > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 650;
  color: #334155;
  user-select: none;
}

.sor-detail-more > summary::-webkit-details-marker,
.sor-detail-notes-block > summary::-webkit-details-marker {
  display: none;
}

.sor-detail-more > summary::after,
.sor-detail-notes-block > summary::after {
  content: '▾';
  float: right;
  color: #94a3b8;
  font-size: 12px;
}

.sor-detail-more[open] > summary::after,
.sor-detail-notes-block[open] > summary::after {
  content: '▴';
}

.sor-detail-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.sor-detail-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #f8fafc;
}

.sor-detail-kv span { color: #64748b; font-size: 12px; font-weight: 600; }

.sor-detail-kv strong { color: #0f172a; font-size: 13px; word-break: break-all; }

.sor-detail-notes-block p {
  margin: 0;
  padding: 0 14px 12px;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sor-detail-notes {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

.sor-detail-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 10px;
  padding: 3px;
  border-radius: 10px;
  background: #e8eef5;
}

.sor-detail-tab {
  flex: 1;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.sor-detail-tab.is-active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.sor-detail-panel.hidden {
  display: none !important;
}

.sor-detail-follow-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.sor-detail-follow-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
}

.sor-detail-follow-kpi em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.sor-detail-follow-kpi strong {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.sor-detail-follow-kpi span {
  font-size: 12px;
  color: #94a3b8;
}

.sor-detail-section {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 750;
  color: #0f172a;
}

.sor-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
}

.sor-detail-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
}

.sor-detail-table--lines {
  min-width: 560px;
}

.sor-detail-table--follow {
  min-width: 360px;
}

.sor-detail-col-line {
  width: 52px;
}

.sor-detail-col-qty {
  width: 88px;
  white-space: nowrap;
}

.sor-detail-col-sp {
  max-width: 220px;
}

.sor-detail-line-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.sor-detail-meta-dot {
  margin: 0 4px;
  color: #cbd5e1;
}

.sor-detail-meta-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sor-detail-meta-link:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .sor-detail-summary {
    grid-template-columns: 1fr 1fr;
    gap: 10px 0;
  }

  .sor-detail-summary-item {
    border-left: 0;
    padding: 0 8px 0 0;
  }

  .sor-detail-summary-item:nth-child(odd) {
    padding-right: 10px;
    border-right: 1px solid #eef2f6;
  }

  .sor-detail-follow-kpis {
    grid-template-columns: 1fr;
  }
}

.sor-detail-table th {
  padding: 9px 10px;
  border-bottom: 1px solid #e5eaf2;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.sor-detail-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #eef2f6;
  color: #0f172a;
  vertical-align: top;
}

.sor-detail-table tr:last-child td { border-bottom: 0; }

.sor-detail-table td small.hint { display: block; color: #64748b; }

.sor-detail-hint {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.sor-detail-tip {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  vertical-align: top;
}

.sor-detail-tip-anchor {
  cursor: default;
}

.sor-detail-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sor-detail-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.sor-detail-link strong {
  font-weight: 750;
}

.sor-detail-link small.hint,
.sor-detail-muted small.hint {
  display: block;
  color: #64748b;
  text-decoration: none;
}

.sor-detail-muted {
  display: inline-flex;
  flex-direction: column;
  color: #0f172a;
}

.sor-detail-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, 70vw);
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  transition-delay: 0s;
}

.sor-detail-tip:hover > .sor-detail-popover,
.sor-detail-tip:focus-within > .sor-detail-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0.28s;
}

.sor-detail-popover-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  line-height: 1.45;
}

.sor-detail-popover-row + .sor-detail-popover-row {
  border-top: 1px solid #f1f5f9;
}

.sor-detail-popover-row span {
  color: #94a3b8;
  font-weight: 600;
}

.sor-detail-popover-row strong {
  color: #0f172a;
  font-weight: 650;
  word-break: break-word;
}

.sor-detail-popover-cap {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.sor-detail-popover--tasks {
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sor-detail-task-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 26px;
  padding: 2px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.sor-detail-task-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.sor-detail-task-pill.is-empty {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

.sor-detail-task-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.sor-detail-task-link:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.sor-detail-task-link em {
  color: #64748b;
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
}

.sor-detail-popover-foot {
  margin-top: 2px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.sor-detail-popover-foot:hover {
  background: #eff6ff;
  text-decoration: underline;
}

.sor-detail-sp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 240px;
  padding: 0;
  border: 0;
  background: none;
  color: #92400e;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.sor-detail-sp:hover {
  color: #1d4ed8;
}

.sor-detail-sp.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  white-space: normal;
  color: #0f172a;
}

.sor-detail-tip--sp .sor-detail-popover {
  max-width: min(360px, 80vw);
}

.sor-detail-table td:last-child .sor-detail-popover,
.sor-detail-table td:nth-last-child(2) .sor-detail-popover {
  left: auto;
  right: 0;
}

.sor-detail-gaps {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sor-detail-gap {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5eaf2;
  background: #fff;
  font-size: 12px;
}

.sor-detail-gap strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #0f172a;
}

.sor-detail-gap-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #f1f5f9;
  color: #64748b;
}

.sor-detail-gap span { color: #64748b; }

.sor-detail-gap--error { border-color: #fecaca; background: #fef2f2; }

.sor-detail-gap--error strong { color: #b91c1c; }

.sor-detail-gap--error .sor-detail-gap-tag { background: #fee2e2; color: #b91c1c; }

.sor-detail-gap--warn { border-color: #fde68a; background: #fffbeb; }

.sor-detail-gap--warn strong { color: #92400e; }

.sor-detail-gap--warn .sor-detail-gap-tag { background: #fef3c7; color: #92400e; }

.sor-detail-gap--info { border-color: #e2e8f0; background: #f8fafc; }

.sor-detail-gap--info strong { color: #334155; }

.sor-detail-gap--info .sor-detail-gap-tag { background: #e2e8f0; color: #475569; }

.sor-detail-gap--ok { border-color: #bbf7d0; background: #f0fdf4; }

.sor-detail-gap--ok strong { color: #15803d; }

.sor-detail-gap--ok .sor-detail-gap-tag { background: #dcfce7; color: #15803d; }

.sor-detail-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #e5eaf2;
  background: #fff;
}

/* ---- 物料台账右侧详情抽屉 ---- */
.prod-detail-backdrop {
  position: fixed;
  z-index: 5000;
  inset: 0;
  background: rgb(15 23 42 / 0.34);
  backdrop-filter: blur(2px);
}

.prod-detail-backdrop.hidden {
  display: none;
}

.prod-detail-drawer {
  position: fixed;
  z-index: 5001;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(560px, 96vw);
  height: 100dvh;
  background: #f7f9fc;
  box-shadow: -20px 0 60px rgb(15 23 42 / 0.18);
}

.prod-detail-drawer.hidden {
  display: none;
}

.prod-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5eaf2;
  background: #fff;
}

.prod-detail-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.prod-detail-eyebrow {
  display: block;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.prod-detail-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  word-break: break-all;
}

.prod-detail-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.prod-detail-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.prod-detail-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 20px;
}

.prod-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.prod-detail-hero h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.35;
}

.prod-detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.prod-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.prod-detail-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #fff;
}

.prod-detail-kv span {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.prod-detail-kv strong {
  color: #0f172a;
  font-size: 13px;
  word-break: break-all;
}

.prod-detail-section {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.prod-detail-ready {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  background: #fff;
}

.prod-detail-ready.is-missing {
  border-color: #fdba74;
  background: #fff7ed;
}

.prod-detail-ready.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.prod-detail-ready-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prod-detail-ready p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.prod-detail-ready.is-missing p {
  color: #9a3412;
}

.prod-detail-ready.is-ok p {
  color: #166534;
}

.prod-detail-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #e5eaf2;
  background: #fff;
}

body.prod-detail-drawer-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .prod-detail-drawer {
    width: 100vw;
  }
}

/* ---- 销售订单台账（销售协同 · 建单/编辑）---- */
#page-sales-orders {
  background:
    radial-gradient(circle at 88% 0%, rgb(22 119 255 / 0.06), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
}

.sor-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

.sor-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid #e6edf5;
  background: linear-gradient(135deg, #fff 0%, #f7fbff 100%);
}

.sor-hero-badge {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1677ff;
}

.sor-hero h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.sor-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}


.sor-create-modal-content {
  max-width: min(960px, 96vw);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 12px;
  background: #f5f7fb;
}

.sor-create-header {
  align-items: flex-start;
  margin-bottom: 0;
  padding: 16px 22px 12px;
  border-bottom: 1px solid #e8edf5;
  background: #fff;
}

.sor-create-header-text {
  min-width: 0;
  flex: 1;
  padding-right: 12px;
}

.sor-create-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.sor-create-subtitle.of-so-fields-source,
#sor-create-modal .of-so-fields-source {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.sor-create-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.sor-create-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  background: #fff;
  min-width: 0;
}

.sor-create-kpi-card span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.sor-create-kpi-card strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sor-create-kpi-card strong.mono {
  font-size: 14px;
  font-weight: 650;
}

.sor-create-block {
  padding: 14px 16px 16px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: #fff;
}

.sor-create-block-title {
  position: relative;
  margin: 0 0 14px;
  padding-left: 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.sor-create-block-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  border-radius: 2px;
  background: #2563eb;
}

.sor-create-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

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

.sor-field > label {
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.sor-field input,
.sor-field select,
.sor-field textarea,
.sor-field .of-product-combo__input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
  box-sizing: border-box;
}

.sor-field textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}

.sor-field input:focus,
.sor-field select:focus,
.sor-field textarea:focus,
.sor-field .of-product-combo__input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

.sor-field-span {
  grid-column: 1 / -1;
}

.sor-create-modal-content .crm-modal-actions,
.sor-create-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 12px 22px 16px;
  border-top: 1px solid #e8edf5;
  background: #fff;
}

.sor-create-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .sor-create-kpi,
  .sor-create-field-grid {
    grid-template-columns: 1fr;
  }
}

.sor-ai-import-modal-content {
  width: min(1100px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.sor-ai-import-body {
  overflow: auto;
  padding: 12px 16px 8px;
}
.sor-ai-upload-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.sor-ai-confirm-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.2fr);
  gap: 14px;
  min-height: 420px;
}
.sor-ai-preview {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--border, #e4e7ec);
  background: #f8fafc;
}
.sor-ai-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.sor-ai-line {
  border: 1px solid var(--border, #e4e7ec);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.sor-ai-line.is-low {
  border-color: #f5a524;
  background: #fffbeb;
}
.sor-ai-line-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.of-shell-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 860px) {
  .sor-ai-confirm-layout {
    grid-template-columns: 1fr;
  }
}

.sor-create-products {
  margin-top: 0;
}

.sor-create-products-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.sor-create-products-head .sor-create-block-title {
  margin: 0;
}

.sor-create-products-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sor-create-products-status {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  margin-right: 4px;
}

.sor-create-products-empty {
  text-align: center;
}

.sor-create-products-dash {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border: 1px dashed #c7d3e3;
  border-radius: 10px;
  background: #f8fafc;
  color: #2563eb;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.sor-create-products-dash:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.sor-create-products-dash--row {
  margin-top: 10px;
  min-height: 40px;
}

.sor-create-products-empty-hint {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.sor-create-products-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.sor-create-products-shell-main strong {
  display: block;
  color: #1d4ed8;
  font-size: 13px;
}

.sor-create-products-shell-main p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.sor-create-products-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sor-create-products-lines .of-order-items-extra {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

#sor-create-modal .sor-create-first-row .of-product-combo__input {
  width: 100%;
  min-width: 0;
}

.sor-create-line-more {
  margin-top: 10px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

.sor-create-line-more > summary {
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
  user-select: none;
}

.sor-create-line-more > summary::-webkit-details-marker {
  display: none;
}

.sor-create-line-more > summary::before {
  content: '› ';
  color: #94a3b8;
  font-weight: 700;
}

.sor-create-line-more[open] > summary {
  margin-bottom: 10px;
  color: #475569;
}

.sor-create-line-more[open] > summary::before {
  content: '⌄ ';
}

#sor-create-modal .sor-create-extra-row {
  grid-template-columns: minmax(180px, 1.6fr) 100px 88px auto;
}

#sor-create-modal .of-card-fields .of-so-cap-field.hidden,
#sor-create-modal .sor-field.of-so-cap-field.hidden {
  display: none !important;
}

#sor-create-modal .of-product-combo {
  position: relative;
  min-width: 0;
  width: 100%;
}

#sor-create-modal .of-product-combo__list {
  z-index: 120;
}

.sor-filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 14px 16px;
}

.sor-filter-panel label {
  margin: 0;
}

.sor-filter-panel .of-filter-search {
  flex: 1 1 220px;
  min-width: 180px;
}

.sor-table-wrap {
  padding: 0;
  overflow: hidden;
}

.sor-table-wrap .table-wrap {
  border: none;
  border-radius: 0;
}

@media (max-width: 768px) {
  .sor-hero {
    flex-direction: column;
  }

  .sor-hero-actions {
    width: 100%;
  }

  .sor-hero-actions .btn {
    flex: 1 1 auto;
  }
}

/* ---- 订单流程看板（SO 树 / 公差引擎 / 资料包）---- */
.inline-check {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.inline-check input {
  width: auto;
  margin: 0;
}

#page-order-flow {
  --of-so: 160 84% 38%;
  --of-wb: 217 91% 48%;
  --of-sn: 265 86% 52%;
  --of-tree: 172 50% 38%;
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.of-flow-steps,
.of-board-filter,
.of-kpi,
.of-status-cloud,
.of-tolerance-mini,
.of-bt-mini,
.of-caliper-guide {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.of-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 14px;
  padding: 8px;
}

.of-flow-step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.of-flow-step:hover {
  color: #1677ff;
  background: #f8fbff;
}

.of-flow-step::after {
  content: '';
  position: absolute;
  left: 50%;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #e2e8f0;
}

.of-flow-step.active::after {
  background: #1677ff;
}

.of-flow-step span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef6ff;
  color: #1677ff;
}

.of-board-filter {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
}

.of-board-filter label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.of-board-filter input,
.of-board-filter select,
.of-board-select {
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.of-board-filter input:focus,
.of-board-filter select:focus,
.of-board-select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.of-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.of-kpi {
  position: relative;
  min-height: 102px;
  padding: 16px 16px 14px 60px;
}

.of-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 20px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--of-kpi-bg, #eef6ff);
}

.of-kpi::after {
  content: '';
  position: absolute;
  left: 28px;
  top: 32px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--of-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.of-kpi span,
.of-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.of-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: #172033;
  font-size: 25px;
  line-height: 1;
}

.of-kpi-blue { --of-kpi-color: #1677ff; --of-kpi-bg: #e8f3ff; }
.of-kpi-green { --of-kpi-color: #16a34a; --of-kpi-bg: #ecfdf3; }
.of-kpi-orange { --of-kpi-color: #f59e0b; --of-kpi-bg: #fff7e6; }
.of-kpi-purple { --of-kpi-color: #8b5cf6; --of-kpi-bg: #f5f3ff; }
.of-kpi-red { --of-kpi-color: #ef4444; --of-kpi-bg: #fff1f2; }
.of-kpi-cyan { --of-kpi-color: #0ea5e9; --of-kpi-bg: #e6f7ff; }

.of-board-widgets {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(260px, .85fr) minmax(300px, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.of-status-cloud,
.of-tolerance-mini,
.of-bt-mini,
.of-caliper-guide {
  padding: 14px;
}

.of-widget-title {
  margin-bottom: 10px;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.of-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.of-tag-cloud span {
  padding: 5px 9px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.of-mini-judge-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 8px;
}

.of-mini-judge-row input {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
}

.of-bt-mini p,
.of-caliper-guide p {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.of-caliper-guide {
  border-color: #dbeafe;
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
}

.ins-caliper-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
}

.ins-caliper-card strong {
  display: block;
  margin-bottom: 4px;
  color: #172033;
  font-size: 14px;
}

.ins-caliper-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.ins-caliper-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.of-board-table {
  min-width: 1180px;
}

.of-board-table thead th {
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.of-board-table tbody td {
  color: #334155;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .of-board-filter,
  .of-kpi-grid,
  .of-board-widgets {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .of-flow-steps,
  .of-board-filter,
  .of-kpi-grid,
  .of-board-widgets,
  .of-mini-judge-row {
    grid-template-columns: 1fr;
  }
}

/* 订单流程看板 · 附图版紧凑覆盖 */
#page-order-flow .order-flow-hero {
  margin-bottom: 10px;
  padding: 16px 18px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(240 247 255 / 0.95)),
    radial-gradient(circle at 92% 18%, rgb(22 119 255 / 0.12), transparent 18rem);
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

#page-order-flow .order-flow-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#page-order-flow .order-flow-title {
  margin: 0;
  color: #172033;
  font-size: 21px;
  font-weight: 800;
}

#page-order-flow .order-flow-lead {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 13px;
}

#page-order-flow .order-flow-help {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border-color: #e6edf5;
  background: #fff;
}

#page-order-flow .of-flow-steps {
  margin-bottom: 10px;
  padding: 6px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

#page-order-flow .of-flow-step {
  min-height: 32px;
  border-radius: 999px;
}

#page-order-flow .of-flow-step.active {
  background: #eef6ff;
  color: #0958d9;
}

#page-order-flow .of-flow-step::after {
  display: none;
}

#page-order-flow .of-board-filter {
  grid-template-columns: repeat(8, minmax(110px, 1fr)) auto auto;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

#page-order-flow .of-kpi-grid {
  gap: 12px;
  margin-bottom: 12px;
}

#page-order-flow .of-kpi {
  min-height: 88px;
  padding: 14px 16px 12px 56px;
  border-radius: 8px;
}

#page-order-flow .of-kpi::before {
  left: 16px;
  top: 17px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

#page-order-flow .of-kpi::after {
  left: 26px;
  top: 27px;
}

#page-order-flow .of-kpi strong {
  font-size: 24px;
}

#page-order-flow .of-board-widgets {
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.1fr) minmax(320px, 1.1fr);
  gap: 12px;
  margin-bottom: 12px;
}

#page-order-flow .of-status-cloud,
#page-order-flow .of-tolerance-mini,
#page-order-flow .of-bt-mini,
#page-order-flow .of-surface-card {
  border-radius: 8px;
  border-color: #e6edf5;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

#page-order-flow .of-tag-cloud span {
  border-color: #dbeafe;
  background: #f0f7ff;
  color: #175cd3;
}

#page-order-flow .order-flow-zone--onboard {
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #fff;
}

#page-order-flow .order-flow-zone--onboard[open] {
  padding-bottom: 12px;
}

#page-order-flow .order-flow-zone-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 12px 14px;
  cursor: pointer;
  color: #263445;
}

#page-order-flow .order-flow-zone-summary::after {
  content: '展开 / 收起';
  color: #667085;
  font-size: 12px;
  font-weight: 500;
}

#page-order-flow .order-flow-grid--onboard {
  padding: 0 12px;
}

#page-order-flow .order-flow-tools {
  gap: 12px;
}

#page-order-flow .of-card-head--table {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
}

#page-order-flow .of-card-head--table small {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 500;
}

#page-order-flow .of-so-list-card {
  overflow: hidden;
}

#page-order-flow .of-board-table {
  min-width: 1250px;
}

#page-order-flow .of-board-table thead th {
  padding: 12px 10px;
  background: #fbfdff;
  border-bottom: 1px solid #edf2f7;
}

#page-order-flow .of-board-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1f5f9;
}

#page-order-flow .of-board-table tbody tr:hover td {
  background: #f8fbff;
}

.of-type-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e6f4ff;
  color: #0958d9;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1280px) {
  #page-order-flow .of-board-filter,
  #page-order-flow .of-kpi-grid,
  #page-order-flow .of-board-widgets {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

#page-order-flow .order-flow-help {
  margin-bottom: 16px;
}

.order-flow-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 28px;
  margin-bottom: 20px;
  padding: 16px 20px 18px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    hsl(var(--primary) / 0.09) 0%,
    hsl(var(--muted) / 0.45) 48%,
    hsl(var(--card)) 100%
  );
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 0 hsl(var(--border) / 0.6);
}

.order-flow-hero__main {
  flex: 1 1 280px;
  min-width: 0;
}

.order-flow-pipeline--hero {
  flex: 0 1 auto;
  max-width: min(100%, 520px);
  justify-content: flex-end;
  margin-top: 2px;
}

@media (max-width: 720px) {
  .order-flow-pipeline--hero {
    max-width: 100%;
    justify-content: flex-start;
  }
}

.order-flow-zone {
  margin-bottom: 28px;
  padding-bottom: 4px;
  border-bottom: 1px solid hsl(var(--border) / 0.65);
}

.order-flow-zone:last-child,
.order-flow-zone--table {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.order-flow-zone .order-flow-zone-title {
  margin-bottom: 12px;
}

.order-flow-zone--table .of-so-list-card {
  margin-bottom: 0;
}

.order-flow-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.order-flow-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.order-flow-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  max-width: 72ch;
}

.order-flow-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
}

.order-flow-pipeline__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.order-flow-pipeline__item--muted {
  opacity: 0.88;
}

.order-flow-pipeline__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
}

.order-flow-pipeline__item--muted .order-flow-pipeline__dot {
  background: hsl(var(--muted-foreground) / 0.35);
  color: hsl(var(--foreground));
}

.order-flow-pipeline__txt {
  padding-right: 4px;
}

.order-flow-pipeline__sep {
  width: 18px;
  height: 2px;
  margin: 0 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, hsl(var(--border)), hsl(var(--muted-foreground) / 0.25));
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .order-flow-pipeline__sep {
    display: none;
  }

  .order-flow-pipeline__item {
    margin-bottom: 6px;
  }
}

.order-flow-zone-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.order-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.order-flow-grid--onboard {
  gap: 16px;
  margin-bottom: 0;
  align-items: stretch;
}

#page-order-flow .of-surface-card {
  border-radius: 12px;
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
  overflow: hidden;
}

#page-order-flow .of-onboard-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}

#page-order-flow .of-card-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#page-order-flow .of-card-fields {
  flex: 1 1 auto;
}

#page-order-flow .of-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: hsl(var(--muted-foreground, 64748b));
}

.of-flow-profile-badge {
  margin: 0 0 12px;
  padding: 0 4px;
}

.of-page-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 14px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}

.of-page-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}

.of-page-tab:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.6);
}

.of-page-tab.active {
  background: #fff;
  color: #175cd3;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.of-config-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.of-config-intro {
  padding: 18px 20px;
  background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
  border: 1px solid #e2e8f0;
}

.of-config-intro-badge {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.of-config-intro-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.of-config-intro-lead {
  margin: 0 0 12px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.of-config-priority {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.of-config-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.of-config-pill--accent {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.of-config-pill-arrow {
  color: #94a3b8;
  font-size: 12px;
}

.of-config-section {
  overflow: hidden;
}

.of-config-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 0;
}

.of-config-section-head--split {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.of-config-section-head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.of-config-section-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.of-config-section-head p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.of-config-step-no {
  flex: 0 0 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.of-config-section-body {
  padding: 14px 18px 18px;
}

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

.of-config-default-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding-top: 14px;
}

.of-config-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #475569;
  min-width: 180px;
}

.of-config-field--code {
  min-width: 140px;
}

.of-config-field--full {
  width: 100%;
  min-width: 0;
}

.of-config-field input,
.of-config-field select,
.of-config-field textarea {
  font-size: 13px;
}

.of-config-preview-inline {
  padding: 0 18px 16px;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
  padding-top: 14px;
}

.of-config-readiness-card {
  margin: 0 18px 18px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.of-config-readiness-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.of-config-readiness-head h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.of-config-readiness-summary {
  margin: 0;
  font-size: 13px;
}

.of-config-preview-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

.of-flow-steps--compact {
  padding: 8px 10px;
}

.of-config-master-detail {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid #edf2f7;
  min-height: 420px;
}

.of-config-template-nav {
  border-right: 1px solid #edf2f7;
  background: #fbfdff;
  padding: 10px;
  overflow: auto;
  max-height: 520px;
}

.of-config-template-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.of-config-tpl-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.of-config-tpl-item:hover {
  border-color: #93c5fd;
}

.of-config-tpl-item.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
  background: #f8fbff;
}

.of-config-tpl-item strong {
  font-size: 13px;
  color: #0f172a;
}

.of-config-tpl-item code {
  font-size: 11px;
  color: #64748b;
}

.of-config-tpl-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.of-config-tpl-actions {
  display: flex;
  gap: 6px;
}

.of-config-template-detail {
  padding: 16px 18px;
  overflow: auto;
  max-height: 520px;
}

.of-config-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
  color: #64748b;
  padding: 24px;
}

.of-config-detail-empty strong {
  font-size: 15px;
  color: #334155;
  margin-bottom: 6px;
}

.of-config-detail-empty p {
  margin: 0;
  font-size: 13px;
  max-width: 320px;
}

.of-config-detail-head {
  margin-bottom: 16px;
}

.of-config-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 12px;
  margin-bottom: 10px;
}

.of-config-cap-block,
.of-config-ready-block {
  margin-bottom: 16px;
}

.of-config-cap-block h4,
.of-config-ready-block h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.of-config-cap-block .hint {
  margin: 0 0 10px;
}

.of-config-cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.of-config-cap-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.of-config-cap-card.is-on {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.of-config-cap-card-head strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 2px;
}

.of-config-cap-card-head small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
  margin-bottom: 8px;
}

.of-config-cap-toggles {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.of-config-cap-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.of-config-batch-details {
  margin: 0 18px 12px;
  padding: 10px 12px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background: #fafbfc;
}

.of-config-batch-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.of-config-batch-details .of-batch-apply-grid {
  margin-top: 12px;
}

.of-config-bind-table {
  margin: 0 18px 16px;
  max-height: 320px;
  overflow: auto;
}

.of-profile-admin-hint {
  margin: 8px 18px 0;
  color: #b45309;
}

@media (max-width: 960px) {
  .of-config-master-detail {
    grid-template-columns: 1fr;
  }

  .of-config-template-nav {
    border-right: none;
    border-bottom: 1px solid #edf2f7;
    max-height: 220px;
  }

  .of-config-detail-meta {
    grid-template-columns: 1fr;
  }
}

.of-tab-panel.hidden {
  display: none !important;
}

.of-flow-steps--preview {
  pointer-events: none;
  box-shadow: none;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.of-flow-steps--preview .of-flow-step {
  cursor: default;
}

.of-config-steps-caption {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
}

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

.of-import-label {
  cursor: pointer;
  margin: 0;
}

.of-batch-apply {
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
}

.of-batch-apply-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 8px;
}

.of-batch-apply-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  min-width: 140px;
}

.of-batch-check {
  flex-direction: row !important;
  align-items: center !important;
  min-width: auto !important;
}

.of-profile-table-wrap {
  max-height: 280px;
  overflow: auto;
}

.of-profile-editor-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.of-profile-editor-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.of-pe-section-title {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.of-pe-readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.of-pe-readiness-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.of-pe-onboard-fields-grid {
  display: grid;
  gap: 10px;
}

.of-config-onboard-block {
  border-color: #c7ddff !important;
  background: linear-gradient(180deg, #f8fbff 0%, #fbfcfe 100%) !important;
}

.of-config-onboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.of-config-onboard-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.of-so-fields-source {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  color: #475467;
  line-height: 1.45;
}

.of-pe-onboard-readonly {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.of-pe-onboard-field.is-readonly {
  opacity: 0.72;
}

.of-config-onboard-head h4 {
  margin: 0;
}

.of-config-onboard-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #175cd3;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.of-pe-onboard-empty {
  margin: 8px 0 0;
  color: #b45309;
}

.of-pe-onboard-field {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fafbfd;
}

.of-pe-onboard-field-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.of-pe-onboard-field-main strong {
  font-size: 13px;
  color: #344054;
}

.of-pe-onboard-field-main small {
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

.of-pe-onboard-field-checks {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  font-size: 12px;
  color: #475467;
}

.of-pe-onboard-field-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.of-card-fields .of-so-cap-field.hidden,
.of-card-fields label.of-so-cap-field.hidden,
.of-card-fields .of-order-line-inline.of-so-cap-field.hidden {
  display: none !important;
}

.of-profile-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.of-category-bindings .of-profile-table-wrap {
  max-height: 240px;
}

.of-config-bind-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5eaf2;
}

.of-config-bind-block:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.of-config-bind-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.of-config-bind-block-head h4 {
  margin: 0;
  font-size: 14px;
  color: #344054;
}

.of-profile-admin-hint {
  color: #b45309;
  margin: 0 0 8px;
}

#page-order-flow .of-board-filter label:has(#of-default-profile) {
  min-width: 12rem;
}

#page-order-flow .of-card-actions {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid hsl(var(--border) / 0.75);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#page-order-flow .of-card-actions .btn {
  min-width: 8.5rem;
}

.of-step-so {
  box-shadow: inset 0 3px 0 0 hsl(var(--of-so));
}

.of-step-wb {
  box-shadow: inset 0 3px 0 0 hsl(var(--of-wb));
}

.of-step-sn {
  box-shadow: inset 0 3px 0 0 hsl(var(--of-sn));
}

#page-order-flow .of-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid hsl(var(--border) / 0.85);
  font-size: 13px;
}

#page-order-flow .of-card-head--split {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

#page-order-flow .of-card-head-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

#page-order-flow .of-card-fields.form-grid {
  max-width: none;
}

.of-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
}

.of-step-badge--alt {
  background: hsl(var(--of-wb));
  color: #fff;
}

.of-step-badge--sn {
  background: hsl(var(--of-sn));
  color: #fff;
}

.of-card-head--tree {
  border-bottom-color: hsl(var(--of-tree) / 0.35);
}

.of-card-head--judge::before,
.of-card-head--tree::before,
.of-card-head--bt::before,
.of-card-head--ng::before,
.of-card-head--table::before {
  content: '';
  display: block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  margin-right: 2px;
  background: hsl(var(--primary));
}

.of-card-head--tree::before {
  background: hsl(var(--of-tree));
}
.of-card-head--judge::before {
  background: hsl(32 90% 48%);
}
.of-card-head--bt::before {
  background: hsl(217 85% 52%);
}
.of-card-head--ng::before {
  background: hsl(0 72% 52%);
}
.of-card-head--table::before {
  background: hsl(var(--muted-foreground) / 0.55);
}

.form-grid-tight {
  max-width: none;
  grid-template-columns: 110px 1fr;
}

.order-flow-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
  gap: 16px;
  margin-bottom: 0;
  align-items: stretch;
}

@media (max-width: 1080px) {
  .order-flow-tools {
    grid-template-columns: 1fr;
  }
}

.order-flow-tools-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.order-flow-scan-card {
  margin-bottom: 0;
}

#page-order-flow .of-tool-panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#page-order-flow .of-tool-tree {
  min-height: 280px;
}

.of-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.of-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.of-toolbar-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.of-toolbar-profile select {
  min-width: 140px;
}

@media (min-width: 640px) {
  .of-toolbar .of-input-grow {
    flex: 1 1 200px;
    min-width: 180px;
  }

  .of-toolbar-actions {
    flex: 0 0 auto;
  }
}

@media (max-width: 639px) {
  .of-toolbar .of-input-grow {
    flex: 1 1 100%;
    min-width: 0;
  }

  .of-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.of-input-grow {
  flex: 1 1 200px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  font-size: 13px;
}

#page-order-flow .of-product-combo,
#sor-create-modal .of-product-combo {
  position: relative;
  min-width: 0;
  width: 100%;
}

#page-order-flow .of-product-combo__input,
#sor-create-modal .of-product-combo__input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  font-size: 13px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}

#page-order-flow .of-product-combo__input:focus,
#sor-create-modal .of-product-combo__input:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
}

#page-order-flow .of-product-combo__list,
#sor-create-modal .of-product-combo__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 4px 0;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  list-style: none;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  box-shadow: 0 10px 28px hsl(var(--foreground) / 0.12);
}

#page-order-flow .of-product-combo__item,
#sor-create-modal .of-product-combo__item {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  word-break: break-word;
}

#page-order-flow .of-product-combo__item:hover,
#page-order-flow .of-product-combo__item[aria-selected='true'],
#sor-create-modal .of-product-combo__item:hover,
#sor-create-modal .of-product-combo__item[aria-selected='true'] {
  background: hsl(var(--muted) / 0.55);
}

#page-order-flow .of-product-combo__item--empty,
#sor-create-modal .of-product-combo__item--empty {
  cursor: default;
  color: hsl(var(--muted-foreground));
}

.of-judge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .of-judge-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.of-judge-grid input {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  font-size: 13px;
}

.of-judge-btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.of-judge-out {
  margin: 0;
  min-height: 1.25em;
  font-weight: 500;
}

#page-order-flow .of-tool-judge .hint.of-judge-out {
  margin-bottom: 0;
  padding-bottom: 10px;
}

.of-tool-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

.of-bt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.of-bt-status {
  margin: 0;
}

.of-ng-refresh {
  margin: 0;
  flex-shrink: 0;
}

.order-flow-pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace);
  background: hsl(var(--muted) / 0.35);
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: hsl(var(--foreground));
}

.order-flow-pre--tree {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: min(420px, 52vh);
  margin-top: 0;
}

.order-flow-pre--short {
  max-height: 220px;
}

.order-flow-pre--ng {
  flex: 1 1 auto;
  min-height: 120px;
  margin-top: 0;
}

#page-order-flow .of-tool-ng {
  flex: 1 1 auto;
  min-height: 0;
}

.order-flow-pre:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.of-so-list-card {
  margin-top: 0;
}

.of-so-table-wrap {
  border-radius: 0 0 10px 10px;
}

.oqc-scan-card {
  margin-bottom: 12px;
}

.oqc-sn-input {
  min-width: 200px;
  flex: 1;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  font-size: 14px;
}

.oqc-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.oqc-panel-wide {
  grid-column: 1 / -1;
}

.oqc-pre-short {
  max-height: 220px;
}

.oqc-meas-wrap {
  max-height: 280px;
  overflow: auto;
}

.oqc-curve-host {
  min-height: 160px;
  margin: 8px 0;
}

.oqc-curve-host svg {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  border: 1px solid #e8e8e8;
  background: #fff;
}

.oqc-curve-json {
  margin-top: 10px;
}

.oqc-textarea {
  width: 100%;
  margin: 8px 0;
  padding: 8px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  border: 1px solid #d9d9d9;
}

.oqc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

@media (max-width: 960px) {
  .oqc-panels {
    grid-template-columns: 1fr;
  }
}

/* 订单流程看板 · 最终布局校准（覆盖旧工具样式） */
#page-order-flow .order-flow-hero {
  margin-bottom: 10px;
  padding: 16px 18px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(240 247 255 / 0.95)),
    radial-gradient(circle at 92% 18%, rgb(22 119 255 / 0.12), transparent 18rem);
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

#page-order-flow .order-flow-title {
  margin: 0;
  color: #172033;
  font-size: 21px;
  font-weight: 800;
}

#page-order-flow .order-flow-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-weight: 800;
  letter-spacing: 0.16em;
}

#page-order-flow .order-flow-zone--onboard {
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #fff;
}

#page-order-flow .order-flow-zone--onboard[open] {
  padding-bottom: 12px;
}

#page-order-flow .order-flow-zone-summary {
  margin: 0;
  padding: 12px 14px;
  cursor: pointer;
}

#page-order-flow .order-flow-zone-summary::after {
  content: '展开 / 收起';
  float: right;
  color: #667085;
  font-size: 12px;
  font-weight: 500;
}

#page-order-flow .order-flow-grid--onboard {
  padding: 0 12px;
}

#page-order-flow .of-card-head--table {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
}

#page-order-flow .of-card-head--table small {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 500;
}

/* 订单流程看板 · 附图一屏式最终覆盖 */
#page-order-flow {
  background: #f5f8fc;
}

#page-order-flow .order-flow-hero {
  display: block;
  margin: 0;
  padding: 4px 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-order-flow .order-flow-title {
  margin: 0 0 4px;
  color: #1f2937;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#page-order-flow .order-flow-lead {
  max-width: none;
  margin: 0;
  color: #667085;
  font-size: 12px;
}

#page-order-flow .order-flow-datebar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 12px;
  color: #667085;
  font-size: 12px;
}

#page-order-flow .order-flow-datebar input {
  height: 28px;
  border: 1px solid #d9e4f2;
  border-radius: 4px;
  background: #fff;
  color: #344054;
  font-size: 12px;
}

#page-order-flow .of-flow-steps {
  height: 38px;
  margin-bottom: 10px;
  padding: 0;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
}

#page-order-flow .of-flow-step {
  min-height: 36px;
  color: #667085;
  font-size: 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
}

#page-order-flow .of-flow-step span {
  width: 18px;
  height: 18px;
  background: #eff6ff;
  color: #1677ff;
  font-size: 11px;
}

#page-order-flow .of-flow-step.active {
  background: transparent;
  color: #175cd3;
}

#page-order-flow .of-flow-step.active::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: #1677ff;
}

#page-order-flow .of-board-filter {
  grid-template-columns: repeat(5, minmax(128px, 1fr)) 90px 1.7fr minmax(110px, .8fr) auto auto;
  gap: 10px 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

#page-order-flow .of-filter-title {
  grid-column: 1 / -1;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

#page-order-flow .of-board-filter label {
  gap: 6px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}

#page-order-flow .of-board-filter input,
#page-order-flow .of-board-filter select,
#page-order-flow .of-board-select {
  min-height: 32px;
  border-radius: 4px;
  border-color: #d9e4f2;
  font-size: 12px;
}

#page-order-flow .of-kpi-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

#page-order-flow .of-kpi {
  min-height: 86px;
  padding: 14px 14px 12px 56px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

#page-order-flow .of-kpi span,
#page-order-flow .of-kpi small {
  color: #8a98ab;
  font-size: 11px;
}

#page-order-flow .of-kpi strong {
  margin: 7px 0 4px;
  color: #1f2937;
  font-size: 24px;
}

#page-order-flow .of-board-widgets {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) minmax(360px, 1.15fr);
  gap: 12px;
  margin-bottom: 12px;
}

#page-order-flow .of-status-cloud,
#page-order-flow .of-tolerance-mini,
#page-order-flow .of-bt-mini,
#page-order-flow .of-so-list-card {
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

#page-order-flow .of-status-cloud,
#page-order-flow .of-tolerance-mini,
#page-order-flow .of-bt-mini {
  min-height: 112px;
  padding: 12px 14px;
}

#page-order-flow .of-widget-title {
  margin-bottom: 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

#page-order-flow .of-tag-cloud {
  gap: 7px;
}

#page-order-flow .of-tag-cloud span {
  padding: 4px 8px;
  border-radius: 999px;
  border-color: #dbeafe;
  background: #eef6ff;
  color: #175cd3;
  font-size: 11px;
}

#page-order-flow .of-mini-judge-row {
  grid-template-columns: repeat(4, minmax(70px, 1fr)) auto;
  gap: 8px;
}

#page-order-flow .of-mini-judge-row input {
  min-height: 30px;
  border-radius: 4px;
  border-color: #d9e4f2;
  font-size: 12px;
}

#page-order-flow .of-judge-out {
  min-height: 18px;
  margin: 8px 0 0;
}

#page-order-flow .of-bt-mini p {
  color: #667085;
  font-size: 12px;
}

#page-order-flow .of-card-head--table {
  padding: 11px 14px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

#page-order-flow .of-board-table {
  min-width: 1240px;
}

#page-order-flow .of-board-table thead th {
  padding: 10px 10px;
  background: #fbfdff;
  color: #667085;
  font-size: 12px;
  border-bottom: 1px solid #edf2f7;
}

#page-order-flow .of-board-table tbody td {
  padding: 9px 10px;
  color: #344054;
  font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
}

#page-order-flow .of-board-table tbody tr:hover td {
  background: #f8fbff;
}

@media (max-width: 1280px) {
  #page-order-flow .of-board-filter,
  #page-order-flow .of-kpi-grid,
  #page-order-flow .of-board-widgets {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

/* ---- 校验提醒记录（QCData 风格增强）---- */
.crm-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  padding: 0;
  border-bottom: 1px solid #e8e8e8;
}

.crm-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #595959;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.crm-tab:hover {
  color: hsl(var(--primary));
}

.crm-tab-active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
}

.crm-toolbar {
  flex-wrap: wrap;
  align-items: flex-end;
}

.crm-switch-inline input[type='checkbox'] {
  width: 40px;
  height: 22px;
  cursor: pointer;
  accent-color: hsl(var(--success));
}

.crm-cal-ok {
  color: #389e0d;
  font-weight: 500;
}

.crm-title-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-email-cell {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-readonly {
  background: #f5f5f5;
  color: #595959;
}

.crm-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}

.crm-modal-input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid #d9d9d9;
  font-size: 14px;
}

.crm-modal-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cr-settings-body,
.cr-cal-form {
  padding: 12px 16px 16px;
}

.cr-cal-months-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cr-cal-months-row select {
  flex: 0 0 120px;
}

.cr-cal-months-row input {
  flex: 1;
  min-width: 60px;
}

.cr-cal-hint {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}

.cr-cal-rem-wrap {
  grid-column: 1 / -1;
}

.crm-table {
  font-size: 12px;
}

/* 校验提醒记录 · Calibration Reminder Command Center */
#page-cal-reminders {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-cal-reminders .crm-command-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#page-cal-reminders .crm-hero,
#page-cal-reminders .crm-tabs,
#page-cal-reminders .compact-help-details,
#page-cal-reminders .crm-toolbar,
#page-cal-reminders #cr-manual-modal,
#page-cal-reminders .crm-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-cal-reminders .crm-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-cal-reminders .crm-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-cal-reminders .crm-hero > * {
  position: relative;
  z-index: 1;
}

#page-cal-reminders .crm-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-cal-reminders .crm-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-cal-reminders .crm-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-cal-reminders .crm-hero p:not(.crm-hero-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-cal-reminders .crm-hero-tags,
#page-cal-reminders .crm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-cal-reminders .crm-hero-tags {
  margin-top: 14px;
}

#page-cal-reminders .crm-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-cal-reminders .crm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

#page-cal-reminders .crm-kpi {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-cal-reminders .crm-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--crm-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-cal-reminders .crm-kpi-green { --crm-kpi-color: #22c55e; }
#page-cal-reminders .crm-kpi-red { --crm-kpi-color: #ef4444; }
#page-cal-reminders .crm-kpi-purple { --crm-kpi-color: #8b5cf6; }

#page-cal-reminders .crm-kpi span,
#page-cal-reminders .crm-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-cal-reminders .crm-kpi strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-cal-reminders .crm-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 0;
  padding: 16px !important;
  border-bottom: 0 !important;
}

#page-cal-reminders .crm-tabs-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-cal-reminders .crm-tabs-head strong,
#page-cal-reminders .crm-console-head strong,
#page-cal-reminders .crm-panel-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-cal-reminders .crm-tabs-head p,
#page-cal-reminders .crm-console-head p,
#page-cal-reminders .crm-panel-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-cal-reminders .crm-tab {
  margin: 0;
  padding: 8px 14px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--ai-sub);
  font-size: 13px;
  font-weight: 850;
}

#page-cal-reminders .crm-tab:hover,
#page-cal-reminders .crm-tab-active {
  background: #eaf4ff;
  color: var(--ai-blue);
  border-color: rgb(47 125 255 / 0.18);
  box-shadow: 0 8px 18px rgb(47 125 255 / 0.08);
}

#page-cal-reminders #crm-panel-records,
#page-cal-reminders #crm-panel-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#page-cal-reminders #crm-panel-records.hidden,
#page-cal-reminders #crm-panel-board.hidden {
  display: none !important;
}

#page-cal-reminders .compact-help-details {
  overflow: hidden;
}

#page-cal-reminders .crm-toolbar {
  align-items: center;
  padding: 18px !important;
}

#page-cal-reminders .crm-toolbar::before {
  content: none !important;
  display: none !important;
}

#page-cal-reminders .crm-console-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-cal-reminders .crm-toolbar input,
#page-cal-reminders .crm-toolbar select {
  height: 38px;
  border-radius: 999px;
}

#page-cal-reminders #cr-manual-modal {
  padding: 18px !important;
}

#page-cal-reminders .crm-panel {
  overflow: hidden;
  padding: 0 !important;
}

#page-cal-reminders .crm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf3fb;
}

#page-cal-reminders .crm-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#page-cal-reminders .crm-table-wrap .data-table thead th {
  background: #f6faff;
  color: #5b6b84;
  font-size: 12px;
  font-weight: 900;
}

#page-cal-reminders .crm-table-wrap .data-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-cal-reminders .crm-table-wrap .data-table tbody tr:hover td {
  background: #f8fbff;
}

#page-cal-reminders .crm-switch-inline input[type='checkbox'] {
  accent-color: #22c55e;
}

#page-cal-reminders .crm-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-cal-reminders .crm-empty-cell strong,
#page-cal-reminders .crm-empty-cell span {
  display: block;
}

#page-cal-reminders .crm-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-cal-reminders .crm-hero,
  #page-cal-reminders .crm-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #page-cal-reminders .crm-kpi-grid {
    grid-template-columns: 1fr;
  }
}


/* ========== 质量运营驾驶舱 ========== */
#page-dashboard {
  background:
    radial-gradient(circle at 8% 0%, rgb(22 119 255 / 0.11), transparent 28rem),
    radial-gradient(circle at 96% 12%, rgb(14 165 233 / 0.1), transparent 22rem),
    linear-gradient(180deg, #f7fbff 0%, #f4f7fb 100%);
}

.qod-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qod-hero,
.qod-command-strip,
.qod-card {
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.05);
}

.qod-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
  padding: 20px 22px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(232 243 255 / 0.88)),
    linear-gradient(90deg, rgb(22 119 255 / 0.08), transparent);
}

.qod-hero::after {
  content: '';
  position: absolute;
  right: -54px;
  top: -84px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgb(22 119 255 / 0.1);
}

.qod-hero-main,
.qod-hero-panel {
  position: relative;
  z-index: 1;
}

.qod-eyebrow,
.qod-section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 0 8px;
  color: #1677ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.qod-title {
  margin: 0;
  color: #172033;
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 820;
  letter-spacing: -0.03em;
}

.qod-lead {
  max-width: 760px;
  margin: 9px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.75;
}

.qod-hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgb(22 119 255 / 0.14);
  border-radius: 13px;
  background: rgb(255 255 255 / 0.76);
  backdrop-filter: blur(8px);
}

.qod-hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qod-status-pill,
.qod-updated {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #dbe7f4;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 760;
}

.qod-status-ok {
  border-color: rgb(5 150 105 / 0.24);
  background: rgb(5 150 105 / 0.08);
  color: #047857;
}

.qod-status-warn {
  border-color: rgb(217 119 6 / 0.28);
  background: rgb(245 158 11 / 0.1);
  color: #b45309;
}

.qod-status-danger {
  border-color: rgb(220 38 38 / 0.25);
  background: rgb(239 68 68 / 0.08);
  color: #b91c1c;
}

.qod-command-strip {
  padding: 14px;
}

.qod-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.qod-kpi {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 14px 15px 13px;
  text-align: left;
  border: 1px solid #e6edf5;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.04);
  cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.qod-kpi::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--qod-tone, #1677ff);
}

.qod-kpi::after {
  content: '';
  position: absolute;
  right: -28px;
  top: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--qod-tone, #1677ff) 13%, transparent);
}

.qod-kpi:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--qod-tone, #1677ff) 34%, #dbe7f4);
  box-shadow: 0 14px 30px rgb(15 23 42 / 0.08);
}

.qod-kpi > span,
.qod-kpi small {
  position: relative;
  z-index: 1;
}

.qod-kpi > span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.qod-kpi strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: #172033;
  font-size: 30px;
  font-weight: 860;
  line-height: 1;
}

.qod-kpi small {
  display: block;
  margin-top: 8px;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.35;
}

.qod-kpi-blue { --qod-tone: #1677ff; }
.qod-kpi-green { --qod-tone: #059669; }
.qod-kpi-warn { --qod-tone: #d97706; }
.qod-kpi-purple { --qod-tone: #7c3aed; }
.qod-kpi-orange { --qod-tone: #ea580c; }
.qod-kpi-red { --qod-tone: #dc2626; }

.qod-signal-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.qod-signal-card {
  min-height: 88px;
  padding: 12px 13px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
}

.qod-signal-label,
.qod-signal-card small {
  display: block;
  color: #7b8798;
  font-size: 12px;
}

.qod-signal-card strong {
  display: block;
  margin: 8px 0 5px;
  color: #172033;
  font-size: 23px;
  font-weight: 820;
  line-height: 1;
}

.qod-signal-ok {
  border-color: rgb(5 150 105 / 0.2);
  background: linear-gradient(180deg, rgb(5 150 105 / 0.06), #fff);
}

.qod-signal-warn {
  border-color: rgb(217 119 6 / 0.24);
  background: linear-gradient(180deg, rgb(245 158 11 / 0.08), #fff);
}

.qod-signal-danger {
  border-color: rgb(220 38 38 / 0.22);
  background: linear-gradient(180deg, rgb(239 68 68 / 0.07), #fff);
}

.qod-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

#page-dashboard {
  min-height: auto !important;
}

#page-dashboard .qod-pipeline-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.05);
}

#page-dashboard .qod-pipe-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #f8fbff;
  color: #172033;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out), transform .16s var(--ease-out);
}

#page-dashboard .qod-pipe-step strong {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  color: inherit;
  font-size: 13px;
  text-align: center;
}

#page-dashboard .qod-pipe-step:hover {
  transform: translateY(-1px);
  border-color: rgb(22 119 255 / 0.32);
  background: #eef6ff;
}

#page-dashboard .qod-pipe-blue strong { color: #1677ff; }
#page-dashboard .qod-pipe-green strong { color: #059669; }
#page-dashboard .qod-pipe-warn strong { color: #d97706; }
#page-dashboard .qod-pipe-purple strong { color: #7c3aed; }
#page-dashboard .qod-pipe-orange strong { color: #ea580c; }
#page-dashboard .qod-pipe-red strong { color: #dc2626; }

#page-dashboard .qod-pipe-arrow {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  user-select: none;
}

#page-dashboard .qod-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  padding: 12px;
}

#page-dashboard .qod-empty-action {
  border: 0;
  background: transparent;
  color: #1677ff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#page-dashboard .qod-empty-action:hover {
  color: #0f5bd6;
}

body.layout-pro #page-dashboard .qod-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 18px;
}

body.layout-pro #page-dashboard .qod-lead {
  display: none;
}

body.layout-pro #page-dashboard .qod-title {
  font-size: 22px;
}

body.layout-pro #page-dashboard .qod-hero-panel {
  min-width: 260px;
  padding: 10px 12px;
}

.qod-main,
.qod-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qod-side {
  position: sticky;
  top: 14px;
}

.qod-card {
  padding: 16px;
}

.qod-card h3 {
  margin: 0;
  color: #172033;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.qod-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.qod-card-head-compact {
  margin-bottom: 10px;
}

.qod-card-head p {
  margin: 5px 0 0;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.5;
}

.qod-trend-card {
  padding-bottom: 18px;
}

.qod-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: -3px 0 14px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.qod-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qod-trend-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #1677ff;
}

.qod-trend-legend .is-completed { background: #059669; }
.qod-trend-legend .is-overdue { background: #d97706; }
.qod-trend-legend .is-ng { background: #dc2626; }
.qod-trend-legend .is-rate { background: #7c3aed; }

.qod-trend-grid {
  display: block;
}

.qod-trend-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.qod-trend-svg rect.is-created { fill: #1677ff; }
.qod-trend-svg rect.is-completed { fill: #059669; }
.qod-trend-svg rect.is-overdue { fill: #d97706; }
.qod-trend-svg rect.is-ng { fill: #dc2626; }

.qod-trend-gridline {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.qod-trend-axis {
  fill: #94a3b8;
  font-size: 10px;
  font-weight: 600;
}

.qod-trend-axis.is-rate { fill: #7c3aed; }

.qod-trend-rate-line {
  fill: none;
  stroke: #7c3aed;
  stroke-width: 2;
  stroke-linejoin: round;
}

.qod-trend-svg circle.is-rate { fill: #7c3aed; }

.qod-todo-grid,
.qod-exception-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.qod-list-block {
  min-width: 0;
}

.qod-list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.qod-list-title::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #1677ff;
}

.qod-list-title-warn::before { background: #d97706; }
.qod-list-title-blue::before { background: #1677ff; }
.qod-list-title-green::before { background: #059669; }
.qod-list-title-purple::before { background: #7c3aed; }
.qod-list-title-danger::before { background: #dc2626; }

.qod-list,
.qod-priority-list,
.qod-exception-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qod-list-item,
.qod-priority-item,
.qod-exception-item {
  border: 1px solid #e6edf5;
  border-radius: 11px;
  background: #f8fbff;
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out), transform .16s var(--ease-out);
}

.qod-list-item,
.qod-priority-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
  color: #172033;
  cursor: pointer;
}

.qod-list-item {
  justify-content: space-between;
}

.qod-list-item:hover,
.qod-priority-item:hover,
.qod-shortcuts button:hover {
  transform: translateY(-1px);
  border-color: rgb(22 119 255 / 0.32);
  background: #eef6ff;
}

.qod-list-item.is-danger {
  border-color: rgb(220 38 38 / 0.22);
  background: rgb(239 68 68 / 0.05);
}

.qod-item-main,
.qod-priority-copy {
  min-width: 0;
}

.qod-item-main strong,
.qod-item-main small,
.qod-item-meta,
.qod-priority-copy strong,
.qod-priority-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qod-item-main strong,
.qod-priority-copy strong {
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.qod-item-main small,
.qod-item-meta,
.qod-priority-copy small {
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.35;
}

.qod-item-meta {
  flex: 0 0 auto;
  text-align: right;
}

.qod-empty {
  padding: 18px 12px;
  border: 1px dashed #cbd8e8;
  border-radius: 11px;
  color: #7b8798;
  text-align: center;
  font-size: 12px;
  background: #fff;
}

.qod-priority-card {
  border-color: rgb(22 119 255 / 0.18);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.qod-priority-badge {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.qod-priority-danger {
  border-color: rgb(220 38 38 / 0.22);
  background: rgb(239 68 68 / 0.05);
}

.qod-priority-danger .qod-priority-badge {
  background: #dc2626;
  color: #fff;
}

.qod-priority-warn {
  border-color: rgb(217 119 6 / 0.24);
  background: rgb(245 158 11 / 0.06);
}

.qod-priority-warn .qod-priority-badge {
  background: #d97706;
  color: #fff;
}

.qod-priority-info .qod-priority-badge {
  background: #1677ff;
  color: #fff;
}

.qod-exception-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
}

.qod-exception-item.is-ng {
  border-color: rgb(220 38 38 / 0.2);
  background: rgb(239 68 68 / 0.05);
}

.qod-exception-copy strong,
.qod-exception-copy small,
.qod-exception-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qod-exception-copy strong {
  color: #172033;
  font-size: 13px;
}

.qod-exception-copy small,
.qod-exception-copy span {
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
}

.qod-exception-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.qod-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.qod-shortcuts button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #f8fbff;
  color: #172033;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.qod-advice {
  margin: 0;
  padding-left: 18px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.75;
}

.qod-advice li + li {
  margin-top: 6px;
}

@media (max-width: 1360px) {
  .qod-kpi-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .qod-signal-row { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 1180px) {
  .qod-layout { grid-template-columns: 1fr; }
  .qod-side { position: static; }
}

@media (max-width: 900px) {
  .qod-hero { grid-template-columns: 1fr; }
  .qod-hero-actions { grid-template-columns: 1fr; }
  .qod-kpi-grid,
  .qod-signal-row,
  .qod-trend-grid,
  .qod-todo-grid,
  .qod-exception-grid,
  .qod-shortcuts { grid-template-columns: 1fr; }
  #page-dashboard .qod-pipeline-strip {
    gap: 6px;
  }
  #page-dashboard .qod-pipe-arrow {
    display: none;
  }
  #page-dashboard .qod-pipe-step {
    flex: 1 1 calc(50% - 6px);
    justify-content: space-between;
  }
}

/* ========== 创建任务单 · 蓝白业务表单 ========== */
#page-create-task {
  background:
    radial-gradient(circle at 12% 0%, rgb(20 116 230 / 0.08), transparent 28rem),
    linear-gradient(180deg, #f7fbff 0%, #f4f7fb 100%);
}

.ct-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ct-hero,
.ct-layout,
.ct-section,
.ct-footer-actions,
.ct-side .card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.05);
}

.ct-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
}

.ct-hero-main,
.ct-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ct-hero-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e6f2ff, #ffffff);
  color: #1677ff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgb(22 119 255 / 0.18);
}

.ct-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.ct-hero p {
  margin: 5px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.ct-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ct-main,
.ct-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ct-tip {
  padding: 10px 14px;
  color: #64748b;
  font-size: 12px;
  background: linear-gradient(90deg, #ffffff, #f7fbff);
}

.ct-section {
  padding: 18px 20px 20px;
}

.ct-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #182335;
}

.ct-section-title span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1677ff, #4da3ff);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ct-section-title strong {
  font-size: 15px;
}

.ct-section-title small {
  color: #7b8798;
  font-size: 12px;
  font-weight: 500;
}

.ct-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px 18px;
}

.ct-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #354156;
  font-size: 12px;
  font-weight: 650;
}

.ct-form-grid input,
.ct-form-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), background .16s var(--ease-out);
}

.ct-form-grid input:focus,
.ct-form-grid select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.ct-form-grid input[readonly] {
  background: #f8fafc;
  color: #64748b;
}

.ct-override-reason {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 650;
}

.ct-override-reason input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #1f2937;
  font: inherit;
  font-size: 13px;
}

.ct-form-grid-flow {
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.1fr) minmax(220px, 1fr);
  align-items: end;
}

.ct-gate-check {
  min-height: 40px;
  flex-direction: row !important;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fbfdff;
  color: #475569 !important;
}

.ct-gate-check input {
  width: auto;
  min-height: auto;
  accent-color: #1677ff;
}

.ct-flow-path {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f4f8ff;
}

.ct-flow-path span {
  position: relative;
  flex: 1;
  padding: 6px 8px;
  border-radius: 7px;
  background: #fff;
  color: #4b607c;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  box-shadow: inset 0 0 0 1px #e2eaf5;
}

.ct-flow-path span:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: #b7c7dc;
}

.ct-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.ct-footer-actions .btn-primary {
  margin-left: auto;
  min-width: 160px;
}

.ct-side .card {
  padding: 16px;
}

.ct-side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  color: #1e293b;
  font-size: 13px;
}

.ct-side-title span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1677ff;
  font-size: 11px;
  font-weight: 750;
}

.ct-summary-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 12px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  overflow: hidden;
}

.ct-summary-tabs span {
  padding: 9px 6px;
  color: #718096;
  font-size: 11px;
  text-align: center;
  background: #fbfdff;
  border-right: 1px solid #edf2f7;
}

.ct-summary-tabs span:last-child {
  border-right: 0;
}

.ct-summary-tabs .active {
  background: #f0fff7;
  color: #16a34a;
  font-weight: 800;
}

.ct-summary-score {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: end;
  gap: 6px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fbff, #ffffff);
}

.ct-summary-score strong {
  color: #176bd6;
  font-size: 30px;
  line-height: 1;
}

.ct-summary-score span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ct-summary-score small {
  justify-self: end;
  max-width: 150px;
  color: #64748b;
  font-size: 11px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-summary dl {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
  color: #516173;
  font-size: 12px;
}

.ct-summary dt {
  color: #8a97a8;
}

.ct-summary dd {
  margin: 0;
  min-width: 0;
  color: #2f3a4a;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-guide ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ct-guide li {
  position: relative;
  padding-left: 26px;
}

.ct-guide li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #1677ff;
  background: #fff;
}

.ct-guide b,
.ct-guide span {
  display: block;
}

.ct-guide b {
  color: #314056;
  font-size: 12px;
}

.ct-guide span {
  margin-top: 3px;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.5;
}

.ct-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ct-quick-grid button {
  min-height: 54px;
  padding: 8px 4px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #fbfdff;
  color: #516173;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ct-quick-grid button:hover {
  border-color: rgb(22 119 255 / 0.32);
  background: #eef6ff;
  color: #1677ff;
}

@media (max-width: 1280px) {
  .ct-layout {
    grid-template-columns: 1fr;
  }

  .ct-side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ct-hero,
  .ct-hero-main,
  .ct-hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .ct-form-grid,
  .ct-form-grid-flow,
  .ct-side {
    grid-template-columns: 1fr;
  }

  .ct-footer-actions {
    flex-wrap: wrap;
  }
}

/* ========== 任务单查询 · 卡片式工作台 ========== */
#page-task-query {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.tq-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tq-tabs,
.tq-hero,
.tq-filter-panel,
.tq-results-workspace {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.04);
}

.tq-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  padding: 6px 10px;
  overflow-x: auto;
}

.tq-tabs button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tq-tabs button:hover,
.tq-tabs button.active {
  border-color: rgb(22 119 255 / 0.22);
  background: #eef6ff;
  color: #1677ff;
}

.tq-tabs .tq-refresh {
  margin-left: auto;
  border-color: #e2e8f0;
  background: #fff;
}

.tq-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.tq-hero-main,
.tq-search {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tq-hero-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e8f3ff, #ffffff);
  color: #1677ff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgb(22 119 255 / 0.16);
}

.tq-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.tq-hero p {
  margin: 5px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.tq-search input {
  width: min(360px, 38vw);
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #dfe7f1;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  outline: none;
}

.tq-search input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

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

.tq-kpi {
  position: relative;
  min-height: 96px;
  padding: 15px 16px 14px 60px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 26px rgb(15 23 42 / 0.045);
  cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.tq-kpi:hover {
  transform: translateY(-1px);
  border-color: rgb(22 119 255 / 0.28);
  box-shadow: 0 14px 30px rgb(15 23 42 / 0.08);
}

.tq-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tq-kpi-bg, #eef6ff);
}

.tq-kpi::after {
  content: '';
  position: absolute;
  left: 28px;
  top: 30px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tq-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.tq-kpi span,
.tq-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.tq-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--tq-kpi-color, #1677ff);
  font-size: 25px;
  line-height: 1;
}

.tq-kpi-blue { --tq-kpi-color: #1677ff; --tq-kpi-bg: #e8f3ff; }
.tq-kpi-orange { --tq-kpi-color: #f59e0b; --tq-kpi-bg: #fff7e6; }
.tq-kpi-cyan { --tq-kpi-color: #0ea5e9; --tq-kpi-bg: #e6f7ff; }
.tq-kpi-green { --tq-kpi-color: #16a34a; --tq-kpi-bg: #ecfdf3; }
.tq-kpi-red { --tq-kpi-color: #ef4444; --tq-kpi-bg: #fff1f2; }
.tq-kpi-purple { --tq-kpi-color: #7c3aed; --tq-kpi-bg: #f5f3ff; }

.tq-filter-panel {
  padding: 16px;
}

.tq-filter-head,
.tq-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tq-filter-head {
  margin-bottom: 12px;
  color: #1e293b;
  font-size: 14px;
}

.tq-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.tq-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.tq-filter-grid label span {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tq-filter-grid input,
.tq-filter-grid select {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.tq-filter-grid input:focus,
.tq-filter-grid select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.tq-filter-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.task-bulk-bar.tq-bulk-panel,
.task-bulk-bar.tq-bulk-inline {
  margin: 0;
  padding: 12px 14px;
  border-color: #e6edf5;
  background: #fff;
}

.tq-results-workspace {
  overflow: hidden;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.04);
}

.tq-results-head {
  padding: 16px 18px 0;
}

.tq-results-kicker {
  display: inline-flex;
  margin: 0 0 4px;
  color: #1677ff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
}

.tq-results-intro p {
  margin: 0;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.5;
}

.task-bulk-bar.tq-bulk-inline {
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid #e8eff8;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.tq-results-workspace .task-cards.tq-task-grid {
  margin: 12px 0 0;
  padding: 14px 18px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tq-bulk-panel .task-bulk-count {
  min-width: 78px;
  color: #1677ff;
}

.tq-bulk-panel input[type="text"],
.tq-bulk-panel input[type="datetime-local"] {
  min-height: 34px;
  border-color: #dfe7f1;
  border-radius: 8px;
}

.tq-view-toggle {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.tq-view-toggle span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
}

.tq-view-toggle .active {
  background: #fff;
  color: #1677ff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.task-cards.tq-task-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tq-task-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.tq-task-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.tq-task-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1677ff;
}

.tq-task-section-danger .tq-task-section-dot { background: #ef4444; }
.tq-task-section-warn .tq-task-section-dot { background: #f59e0b; }
.tq-task-section-muted .tq-task-section-dot { background: #94a3b8; }

.tq-task-section-head strong {
  flex: 1;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.tq-task-section-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

body.layout-pro .task-cards.tq-task-grid .task-card,
.task-cards.tq-task-grid .task-card {
  position: relative;
  min-height: 190px;
  padding: 14px 15px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.045);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.task-cards.tq-task-grid .task-card:hover {
  transform: translateY(-2px);
  border-color: rgb(22 119 255 / 0.26);
  box-shadow: 0 16px 34px rgb(15 23 42 / 0.09);
}

.task-card-waiting { --task-card-accent: #f59e0b; }
.task-card-progress { --task-card-accent: #0ea5e9; }
.task-card-done { --task-card-accent: #16a34a; }
.task-card-danger { --task-card-accent: #ef4444; }

.task-cards.tq-task-grid .task-card-top {
  margin-bottom: 12px;
}

.task-cards.tq-task-grid .task-card-badges {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.task-cards.tq-task-grid .task-card-subline {
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.45;
}

.task-cards.tq-task-grid .task-card-progress {
  margin-top: 10px;
}

.task-cards.tq-task-grid .task-card-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.task-cards.tq-task-grid .task-card-progress-head strong {
  color: #64748b;
  font-size: 11px;
}

.task-cards.tq-task-grid .task-card-progress-track {
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.task-cards.tq-task-grid .task-card-progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #1677ff;
}

.task-card-danger .task-card-progress-track span { background: #ef4444; }
.task-card-done .task-card-progress-track span { background: #16a34a; }

.task-cards.tq-task-grid .task-card-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.task-cards.tq-task-grid .task-card-info {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.task-cards.tq-task-grid .task-card-info span {
  display: block;
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.task-cards.tq-task-grid .task-card-info strong {
  display: block;
  color: #172033;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
}

.task-cards.tq-task-grid .task-card-info.is-overdue strong {
  color: #c2410c;
}

.task-cards.tq-task-grid .task-select {
  width: 18px;
  height: 18px;
}

.task-cards.tq-task-grid .task-select input {
  width: 15px;
  height: 15px;
  accent-color: #1677ff;
}

.task-cards.tq-task-grid .task-card-title {
  min-height: 40px;
  margin-bottom: 10px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
}

.task-cards.tq-task-grid .task-card-meta {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 6px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.task-cards.tq-task-grid .task-card-meta span {
  margin: 0;
  color: #94a3b8;
}

.task-cards.tq-task-grid .task-card-actions {
  justify-content: flex-start;
  gap: 8px;
  margin-top: 13px;
}

.task-cards.tq-task-grid .btn-icon {
  min-width: 40px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.task-cards.tq-task-grid .btn-icon:hover {
  border-color: rgb(239 68 68 / 0.26);
  background: #fff1f2;
  color: #ef4444;
}

.tq-empty {
  grid-column: 1 / -1;
  text-align: center;
}

@media (max-width: 1280px) {
  .tq-kpi-grid,
  #page-task-query .tq-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tq-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .tq-hero,
  .tq-hero-main,
  .tq-search,
  .tq-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tq-search input {
    width: 100%;
  }

  .tq-kpi-grid,
  #page-task-query .tq-kpi-grid,
  .tq-filter-grid,
  .tq-filter-grid label span {
    grid-template-columns: 1fr;
  }

  .tq-tabs .tq-refresh,
  .tq-view-toggle {
    margin-left: 0;
  }
}

/* ========== 我的任务 · 个人任务台 ========== */
#page-my-tasks {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.mytask-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mytask-tabs,
.mytask-hero,
.mytask-filter,
.mytask-list-panel,
.mytask-kpi {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.mytask-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  overflow-x: auto;
}

.mytask-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.mytask-tabs button:hover,
.mytask-tabs button.active {
  border-color: rgb(22 119 255 / 0.24);
  background: #eef6ff;
  color: #1677ff;
}

.mytask-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.mytask-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.mytask-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.mytask-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

.mytask-date-filter,
.mytask-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mytask-date-filter span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.mytask-filter input,
.mytask-list-tools select {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.mytask-search input {
  width: min(360px, 38vw);
  border-radius: 999px;
}

.mytask-threshold-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mytask-threshold-field input {
  width: 64px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
}

.mytask-filter input:focus,
.mytask-list-tools select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

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

.mytask-kpi {
  position: relative;
  min-height: 116px;
  padding: 18px 18px 16px 64px;
  text-align: left;
  cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.mytask-kpi:hover {
  transform: translateY(-1px);
  border-color: rgb(22 119 255 / 0.28);
  box-shadow: 0 14px 30px rgb(15 23 42 / 0.08);
}

.mytask-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--mytask-kpi-bg, #eef6ff);
}

.mytask-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mytask-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.mytask-kpi span,
.mytask-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.mytask-kpi strong {
  display: block;
  margin: 10px 0 6px;
  color: #172033;
  font-size: 28px;
  line-height: 1;
}

.mytask-kpi-blue { --mytask-kpi-color: #1677ff; --mytask-kpi-bg: #e8f3ff; border-bottom: 3px solid #1677ff; }
.mytask-kpi-orange { --mytask-kpi-color: #f59e0b; --mytask-kpi-bg: #fff7e6; border-bottom: 3px solid #f59e0b; }
.mytask-kpi-red { --mytask-kpi-color: #ef4444; --mytask-kpi-bg: #fff1f2; border-bottom: 3px solid #ef4444; }
.mytask-kpi-green { --mytask-kpi-color: #16a34a; --mytask-kpi-bg: #ecfdf3; border-bottom: 3px solid #16a34a; }
.mytask-kpi-navy { --mytask-kpi-color: #1d4ed8; --mytask-kpi-bg: #eff6ff; border-bottom: 3px solid #1d4ed8; }
.mytask-kpi-purple { --mytask-kpi-color: #7c3aed; --mytask-kpi-bg: #f5f3ff; border-bottom: 3px solid #7c3aed; }

.mytask-list-panel {
  padding: 16px;
}

.mytask-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.mytask-list-head h3 {
  margin: 0;
  color: #172033;
  font-size: 16px;
}

.mytask-list-head p {
  margin: 5px 0 0;
  color: #7b8798;
  font-size: 12px;
}

.mytask-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.task-cards.mytask-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mytask-task-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.mytask-task-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.mytask-task-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1677ff;
}

.mytask-task-section-danger .mytask-task-section-dot { background: #ef4444; }
.mytask-task-section-warn .mytask-task-section-dot { background: #f59e0b; }
.mytask-task-section-muted .mytask-task-section-dot { background: #94a3b8; }

.mytask-task-section-head strong {
  flex: 1;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.mytask-task-section-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

body.layout-pro .task-cards.mytask-cards .task-card,
.task-cards.mytask-cards .task-card {
  position: relative;
  min-height: 190px;
  padding: 14px 15px;
  border: 1px solid #e6edf5;
  border-left: 3px solid var(--mytask-card-accent, #1677ff);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.045);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.task-cards.mytask-cards .task-card:hover {
  transform: translateY(-2px);
  border-color: rgb(22 119 255 / 0.26);
  box-shadow: 0 16px 34px rgb(15 23 42 / 0.09);
}

.mytask-card-waiting { --mytask-card-accent: #f59e0b; }
.mytask-card-processing { --mytask-card-accent: #0ea5e9; }
.mytask-card-overdue { --mytask-card-accent: #ef4444; }
.mytask-card-done { --mytask-card-accent: #16a34a; }

.task-cards.mytask-cards .task-card-top {
  margin-bottom: 12px;
}

.task-cards.mytask-cards .task-card-badges {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.task-cards.mytask-cards .task-card-subline {
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.45;
}

.task-cards.mytask-cards .task-card-progress {
  margin-top: 10px;
}

.task-cards.mytask-cards .task-card-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.task-cards.mytask-cards .task-card-progress-head strong {
  color: #64748b;
  font-size: 11px;
}

.task-cards.mytask-cards .task-card-progress-track {
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.task-cards.mytask-cards .task-card-progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #1677ff;
}

.mytask-card-overdue .task-card-progress-track span { background: #ef4444; }
.mytask-card-done .task-card-progress-track span { background: #16a34a; }

.task-cards.mytask-cards .task-card-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.task-cards.mytask-cards .task-card-info {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.task-cards.mytask-cards .task-card-info span {
  display: block;
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.task-cards.mytask-cards .task-card-info strong {
  display: block;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-cards.mytask-cards .task-card-info.is-overdue strong {
  color: #c2410c;
}

.task-cards.mytask-cards .task-card-title {
  min-height: auto;
  color: #172033;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.task-cards.mytask-cards .task-card-meta {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 6px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.task-cards.mytask-cards .task-card-meta span {
  margin: 0;
  color: #94a3b8;
}

.task-cards.mytask-cards .task-card-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.task-cards.mytask-cards .btn-icon {
  min-width: 26px;
  height: 24px;
  border: 1px solid #edf2f7;
  border-radius: 999px;
  background: #fff;
  color: #94a3b8;
  font-size: 12px;
}

.mytask-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  color: #64748b;
  font-size: 12px;
}

.mytask-pagination span:last-child {
  display: flex;
  gap: 8px;
}

/* 我的任务 · Task Command Center 深化 */
#page-my-tasks .mytask-tabs,
#page-my-tasks .mytask-hero,
#page-my-tasks .mytask-filter,
#page-my-tasks .mytask-list-panel,
#page-my-tasks .mytask-kpi:not(.is-active) {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(248 251 255 / 0.96)) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.055) !important;
}

#page-my-tasks .mytask-tabs {
  padding: 8px;
  border-radius: 20px !important;
}

#page-my-tasks .mytask-tabs button {
  min-height: 34px;
  border-radius: 999px;
  font-weight: 900;
}

#page-my-tasks .mytask-tabs button:hover,
#page-my-tasks .mytask-tabs button.active {
  background: linear-gradient(90deg, #eaf4ff, #ffffff);
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.12);
}

#page-my-tasks .mytask-hero {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f7fbff) !important;
}

#page-my-tasks .mytask-hero::after {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -34px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.06);
  pointer-events: none;
}

.mytask-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mytask-section-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12);
}

#page-my-tasks .mytask-hero h2 {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-my-tasks .mytask-hero p {
  max-width: 520px;
  color: var(--ai-sub);
  line-height: 1.55;
}

.mytask-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mytask-ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgb(47 125 255 / 0.14);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mytask-ai-chip i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

#page-my-tasks .mytask-filter {
  position: relative;
  padding: 20px 16px 16px;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.1), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
}

.mytask-filter-badge {
  position: absolute;
  left: 18px;
  top: -10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-my-tasks .mytask-search .qcos-field-clear-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(360px, 38vw);
}

#page-my-tasks .mytask-search .qcos-field-clear-wrap > input {
  width: 100%;
  padding-right: 30px !important;
}

#page-my-tasks .mytask-search .qcos-field-clear {
  right: 10px;
  z-index: 3;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
}

#page-my-tasks .mytask-list-tools .qcos-field-clear-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

#page-my-tasks .mytask-list-tools select {
  padding-right: 30px !important;
}

#page-my-tasks .mytask-date-filter,
#page-my-tasks .mytask-search {
  padding: 6px;
  border: 1px solid rgb(47 125 255 / 0.08);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.72);
}

#page-my-tasks .mytask-filter input,
#page-my-tasks .mytask-list-tools select {
  min-height: 40px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-my-tasks .mytask-filter input:focus,
#page-my-tasks .mytask-list-tools select:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

#page-my-tasks .mytask-kpi-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

#page-my-tasks .mytask-kpi.kpi-filter-btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#page-my-tasks .mytask-kpi {
  overflow: hidden;
  min-height: 124px;
  padding: 20px 18px 16px 68px;
}

#page-my-tasks .mytask-kpi:not(.is-active) {
  border-bottom: 0 !important;
}

#page-my-tasks .mytask-kpi::before {
  border-radius: 16px;
  background:
    linear-gradient(135deg, var(--mytask-kpi-bg, #e8f3ff), #ffffff);
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

#page-my-tasks .mytask-kpi::after {
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.78), 0 0 18px color-mix(in srgb, var(--mytask-kpi-color, #1677ff), transparent 55%);
}

#page-my-tasks .mytask-kpi span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-my-tasks .mytask-kpi strong {
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-my-tasks .mytask-kpi small {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(248 251 255 / 0.9);
  color: var(--ai-muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 选中态边框已足够明显，不再追加「 · 已筛选」避免 footer 文字重叠 */
#page-my-tasks .mytask-kpi.kpi-filter-btn.is-active small::after {
  content: none !important;
}

#page-my-tasks .mytask-kpi.kpi-filter-btn.is-active small {
  display: block !important;
  width: auto !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-my-tasks .mytask-list-panel {
  padding: 18px;
}

#page-my-tasks .mytask-list-head h3 {
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

#page-my-tasks .mytask-list-head p {
  color: var(--ai-sub);
}

#page-my-tasks .mytask-list-tools .btn,
#page-my-tasks .mytask-pagination .btn {
  border-radius: 999px !important;
}

#page-my-tasks .mytask-list-tools .btn.active {
  border-color: rgb(47 125 255 / 0.18);
  background: #eef6ff;
  color: var(--ai-blue);
}

body.layout-pro #page-my-tasks .task-cards.mytask-cards .task-card,
#page-my-tasks .task-cards.mytask-cards .task-card {
  overflow: hidden;
  min-height: 196px;
  padding: 16px;
  border: 1px solid var(--ai-line);
  border-top: 0;
  border-left: 3px solid var(--mytask-card-accent, var(--ai-blue));
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 26px rgb(15 43 92 / 0.055);
}

#page-my-tasks .task-cards.mytask-cards .task-card:hover {
  border-color: rgb(47 125 255 / 0.24);
  box-shadow: 0 18px 36px rgb(15 43 92 / 0.1);
}

#page-my-tasks .task-cards.mytask-cards .task-card-top .badge {
  border-radius: 999px !important;
  font-weight: 900 !important;
}

.mytask-task-token {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--ai-blue);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

#page-my-tasks .task-cards.mytask-cards .task-card-meta {
  grid-template-columns: 58px minmax(0, 1fr);
  color: var(--ai-sub);
}

#page-my-tasks .task-cards.mytask-cards .task-card-meta span {
  color: var(--ai-muted);
  font-weight: 900;
}

#page-my-tasks .mytask-action-primary {
  min-height: 32px;
  padding: 6px 13px;
  border-color: rgb(47 125 255 / 0.14) !important;
  border-radius: 999px !important;
  background: #eef6ff !important;
  color: var(--ai-blue) !important;
  font-weight: 950;
}

.mytask-empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 210px;
  padding: 28px;
  border: 1px dashed rgb(47 125 255 / 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgb(47 125 255 / 0.09), transparent 14rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ai-sub);
  text-align: center;
}

.mytask-empty-state strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

.mytask-empty-state p {
  max-width: 480px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.6;
}

.mytask-empty-state > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mytask-empty-orb {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  box-shadow: 0 0 0 10px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.24);
}

/* 全系统功能模块 · Command Center 统一视觉层 */
#page-entry .entry-hero,
#page-create-task .ct-hero,
#page-task-query .tq-hero,
#page-qc-trace .qt-hero,
#page-completed .completed-hero,
#page-ai-review .ai-review-hero,
#page-order-flow .order-flow-hero,
#page-templates .reporttpl-hero,
.kingdee-hero,
.offline-hero,
.iqc-hero,
.mdm-hero,
.mdmp-hero,
.pcc-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ai-line) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f7fbff) !important;
  box-shadow: 0 16px 36px rgb(15 43 92 / 0.06) !important;
}

#page-entry .entry-hero::after,
#page-create-task .ct-hero::after,
#page-task-query .tq-hero::after,
#page-qc-trace .qt-hero::after,
#page-completed .completed-hero::after,
#page-ai-review .ai-review-hero::after,
#page-order-flow .order-flow-hero::after,
#page-templates .reporttpl-hero::after,
.kingdee-hero::after,
.offline-hero::after,
.iqc-hero::after,
.mdm-hero::after,
.mdmp-hero::after,
.pcc-hero::after {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -38px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-entry .entry-hero h2,
#page-create-task .ct-hero h2,
#page-task-query .tq-hero h2,
#page-qc-trace .qt-hero h2,
#page-completed .completed-hero h2,
#page-ai-review .ai-review-hero h2,
#page-order-flow .order-flow-title,
#page-templates .reporttpl-hero h2,
.kingdee-hero h2,
.offline-hero h2,
.iqc-hero h2,
.mdm-hero h2,
.mdmp-hero h2,
.pcc-hero h2 {
  color: var(--ai-text) !important;
  font-weight: 950 !important;
  letter-spacing: -0.03em;
}

#page-entry .entry-hero p,
#page-create-task .ct-hero p,
#page-task-query .tq-hero p,
#page-qc-trace .qt-hero p,
#page-completed .completed-hero p,
#page-ai-review .ai-review-hero p,
#page-order-flow .order-flow-subtitle,
#page-templates .reporttpl-hero p,
.kingdee-hero p,
.offline-hero p,
.iqc-hero p,
.mdm-hero p,
.mdmp-hero p,
.pcc-hero p {
  color: var(--ai-sub) !important;
  line-height: 1.58;
}

#page-entry .entry-search-panel,
#page-task-query .tq-filter-panel,
#page-completed .completed-filter,
#page-ai-review .ai-review-filter,
#page-order-flow .of-board-filter,
#page-templates .fc-toolbar,
.stats-page-toolbar,
.stats-merge-toolbar,
.filter-row,
.iqc-toolbar-card,
.mdm-filter-panel,
.mdmp-filter-panel,
.pcc-filter-panel,
.kingdee-filter,
.offline-filter {
  position: relative;
  border: 1px solid var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.1), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-entry .entry-search-panel::before,
#page-task-query .tq-filter-panel::before,
#page-completed .completed-filter::before,
#page-ai-review .ai-review-filter::before,
#page-order-flow .of-board-filter::before,
#page-templates .fc-toolbar::before,
.stats-page-toolbar::before,
.stats-merge-toolbar::before,
.iqc-toolbar-card::before,
.mdm-filter-panel::before,
.mdmp-filter-panel::before,
.pcc-filter-panel::before,
.kingdee-filter::before,
.offline-filter::before {
  content: 'AI Query Console';
  position: absolute;
  left: 18px;
  top: -10px;
  z-index: 1;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-entry .entry-search-panel input,
#page-task-query .tq-filter-panel input,
#page-task-query .tq-filter-panel select,
#page-completed .completed-filter input,
#page-ai-review .ai-review-filter input,
#page-ai-review .ai-review-filter select,
#page-order-flow .of-board-filter input,
#page-order-flow .of-board-filter select,
#page-templates .fc-toolbar input,
#page-templates .fc-toolbar select,
.stats-page-toolbar input,
.stats-page-toolbar select,
.stats-merge-toolbar input,
.stats-merge-toolbar select,
.filter-row input,
.filter-row select,
.iqc-toolbar-card input,
.iqc-toolbar-card select,
.mdm-filter-panel input,
.mdm-filter-panel select,
.mdmp-filter-panel input,
.mdmp-filter-panel select,
.pcc-filter-panel input,
.pcc-filter-panel select,
.kingdee-filter input,
.kingdee-filter select,
.offline-filter input,
.offline-filter select {
  min-height: 40px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-entry .entry-search-panel input:focus,
#page-task-query .tq-filter-panel input:focus,
#page-task-query .tq-filter-panel select:focus,
#page-completed .completed-filter input:focus,
#page-ai-review .ai-review-filter input:focus,
#page-ai-review .ai-review-filter select:focus,
#page-order-flow .of-board-filter input:focus,
#page-order-flow .of-board-filter select:focus,
#page-templates .fc-toolbar input:focus,
#page-templates .fc-toolbar select:focus,
.stats-page-toolbar input:focus,
.stats-page-toolbar select:focus,
.stats-merge-toolbar input:focus,
.stats-merge-toolbar select:focus,
.filter-row input:focus,
.filter-row select:focus,
.iqc-toolbar-card input:focus,
.iqc-toolbar-card select:focus,
.mdm-filter-panel input:focus,
.mdm-filter-panel select:focus,
.mdmp-filter-panel input:focus,
.mdmp-filter-panel select:focus,
.pcc-filter-panel input:focus,
.pcc-filter-panel select:focus,
.kingdee-filter input:focus,
.kingdee-filter select:focus,
.offline-filter input:focus,
.offline-filter select:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

.tq-kpi:not(.is-active),
.fo-kpi:not(.is-active),
.oqc-kpi:not(.is-active),
.mdm-status-kpi:not(.is-active),
.qt-kpi:not(.is-active),
.completed-kpi:not(.is-active),
.ai-review-kpi:not(.is-active),
.of-kpi:not(.is-active),
.prod-kpi:not(.is-active),
.pcc-kpi:not(.is-active),
.mdmp-kpi:not(.is-active),
.mdm-kpi:not(.is-active),
.iqc-kpi:not(.is-active),
.kpi:not(.is-active) {
  overflow: hidden;
  border: 1px solid var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 30px rgb(15 43 92 / 0.055) !important;
}

.tq-kpi:not(.is-active) strong,
.fo-kpi:not(.is-active) strong,
.oqc-kpi:not(.is-active) strong,
.mdm-status-kpi:not(.is-active) strong,
.qt-kpi:not(.is-active) strong,
.completed-kpi:not(.is-active) strong,
.ai-review-kpi:not(.is-active) strong,
.of-kpi:not(.is-active) strong,
.prod-kpi:not(.is-active) strong,
.pcc-kpi:not(.is-active) strong,
.mdmp-kpi:not(.is-active) strong,
.mdm-kpi:not(.is-active) strong,
.iqc-kpi:not(.is-active) strong,
.kpi:not(.is-active) .kpi-val {
  color: var(--ai-text) !important;
  font-weight: 950 !important;
  letter-spacing: -0.04em;
}

.tq-kpi:not(.is-active) small,
.fo-kpi:not(.is-active) small,
.oqc-kpi:not(.is-active) small,
.mdm-status-kpi:not(.is-active) small,
.qt-kpi:not(.is-active) small,
.completed-kpi:not(.is-active) small,
.ai-review-kpi:not(.is-active) small,
.of-kpi:not(.is-active) small,
.prod-kpi:not(.is-active) small,
.pcc-kpi:not(.is-active) small,
.mdmp-kpi:not(.is-active) small,
.mdm-kpi:not(.is-active) small,
.iqc-kpi:not(.is-active) small,
.kpi:not(.is-active) .kpi-label {
  color: var(--ai-muted) !important;
}

.tq-tabs,
.completed-tabs,
.fc-tabs,
.mdm-tab-bar,
.inspect-tabs,
.ct-summary-tabs {
  border: 1px solid var(--ai-line) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.96), rgb(248 251 255 / 0.94)) !important;
  box-shadow: 0 10px 24px rgb(15 43 92 / 0.045);
}

.tq-tabs button,
.completed-tabs button,
.fc-tabs button,
.mdm-tab,
.inspect-tabs button,
.ct-summary-tabs span {
  border-radius: 999px !important;
  font-weight: 900 !important;
}

.tq-tabs button.active,
.completed-tabs button.active,
.fc-tabs button.active,
.mdm-tab-active,
.inspect-tabs button.active,
.ct-summary-tabs span.active {
  background: linear-gradient(90deg, #eaf4ff, #ffffff) !important;
  color: var(--ai-blue) !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.12);
}

.table-wrap,
.ai-batch-table-wrap,
.ai-draft-table-wrap,
.prod-archive-table-wrap,
.pcc-table-wrap,
.of-so-table-wrap,
.fc-task-table,
.reporttpl-list-card,
.mytask-list-panel,
.completed-list-panel,
.stats-side-card,
.stats-merge-body,
.oqc-panel,
.of-surface-card,
.mdmp-category-side,
.mdmp-template-side {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(248 251 255 / 0.96)) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

.data-table thead th {
  border-bottom-color: rgb(47 125 255 / 0.12) !important;
  background: linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #52627a !important;
  font-weight: 900 !important;
  letter-spacing: .035em;
}

.data-table tbody tr:hover td {
  background:
    linear-gradient(90deg, rgb(234 244 255 / 0.72), rgb(255 255 255 / 0.94)) !important;
}

.task-card,
.qod-card,
.qod-list-block,
.entry-search-empty,
.ct-main-card,
.ct-side-card,
.ped-card,
.ped-side-card,
.ai-draft-detail-card,
.reporttpl-editor,
.card.compact-help-details {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 12px 28px rgb(15 43 92 / 0.05) !important;
}

.task-card .btn,
.table-actions .btn,
.table-actions .btn-delete,
.fc-toolbar-actions .btn,
.tq-filter-actions .btn,
.task-bulk-bar .btn,
.ct-hero-actions .btn,
.prod-toolbar-actions .btn,
.ai-review-toolbar .btn,
.reporttpl-actions .btn,
.stats-toolbar-actions .btn,
.of-toolbar-actions .btn {
  border-radius: 999px !important;
  font-weight: 900 !important;
}

.badge,
.status-badge,
.task-bar-tag,
.of-type-pill,
.fc-tag-pill,
.qod-status-pill,
.prod-iqc-badge {
  border-radius: 999px !important;
  font-weight: 900 !important;
}

.mytask-empty {
  grid-column: 1 / -1;
  text-align: center;
}

.offline-import-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.offline-import-hero,
.offline-import-config,
.offline-import-uploader,
.offline-import-panel {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.offline-import-hero,
.offline-import-config,
.offline-import-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.offline-import-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.offline-import-hero h2,
.offline-import-panel-head h3 {
  margin: 0;
  color: #172033;
}

.offline-import-hero p,
.offline-import-panel-head p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.offline-import-actions,
.offline-import-template-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.offline-import-config label,
.offline-import-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #354156;
  font-size: 12px;
  font-weight: 700;
}

.offline-import-config select,
.offline-import-form select,
.offline-import-form input[type="file"] {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
}

.offline-import-uploader {
  padding: 18px 20px;
}

.offline-import-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 1.5fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: end;
}

.offline-import-check {
  min-height: 38px;
  flex-direction: row !important;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.offline-import-columns {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #cfe0f5;
  border-radius: 10px;
  background: #f8fbff;
}

.offline-import-columns strong {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
}

.offline-import-columns div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.offline-import-columns code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
}

.offline-import-columns code em {
  color: #64748b;
  font-style: normal;
}

.offline-import-columns code.required {
  background: #fff7ed;
  color: #c2410c;
}

.offline-import-columns code.required em {
  color: #c2410c;
}

.offline-import-template-actions {
  margin-top: 12px;
}

/* 数据导入中心 · Offline Import Command Center */
#page-offline-import {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-offline-import .offline-import-page {
  width: 100%;
  max-width: none;
  align-items: stretch;
  box-sizing: border-box;
  gap: 16px;
}

#page-offline-import .offline-import-hero,
#page-offline-import .offline-import-config,
#page-offline-import .offline-import-uploader,
#page-offline-import .offline-import-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-offline-import .offline-import-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-offline-import .offline-import-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-offline-import .offline-import-hero > * {
  position: relative;
  z-index: 1;
}

#page-offline-import .offline-import-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
}

#page-offline-import .offline-import-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-offline-import .offline-import-hero h2 {
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-offline-import .offline-import-hero p,
#page-offline-import .offline-import-panel-head p {
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-offline-import .offline-import-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-offline-import .offline-import-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-offline-import .offline-import-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

#page-offline-import .offline-import-kpi {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-offline-import .offline-import-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--offline-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-offline-import .offline-import-kpi-green { --offline-kpi-color: #22c55e; }
#page-offline-import .offline-import-kpi-red { --offline-kpi-color: #ef4444; }
#page-offline-import .offline-import-kpi-orange { --offline-kpi-color: #f59e0b; }

#page-offline-import .offline-import-kpi span,
#page-offline-import .offline-import-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-offline-import .offline-import-kpi strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-offline-import .offline-import-console-head,
#page-offline-import .offline-import-schema-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-offline-import .offline-import-schema-head {
  margin-top: 16px;
}

#page-offline-import .offline-import-console-head strong,
#page-offline-import .offline-import-schema-head strong,
#page-offline-import .offline-import-panel-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-offline-import .offline-import-console-head p,
#page-offline-import .offline-import-schema-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-offline-import .offline-import-config,
#page-offline-import .offline-import-uploader {
  padding: 18px 20px !important;
}

#page-offline-import .offline-import-config {
  flex-wrap: wrap;
}

#page-offline-import .offline-import-uploader {
  display: block;
}

#page-offline-import .offline-import-form {
  margin-top: 14px;
}

#page-offline-import .offline-import-config select,
#page-offline-import .offline-import-form select,
#page-offline-import .offline-import-form input[type="file"] {
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-offline-import .offline-import-check {
  border-color: rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #f8fbff;
}

#page-offline-import .offline-import-columns {
  padding: 14px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgb(47 125 255 / 0.08), transparent 12rem),
    #f8fbff;
}

#page-offline-import .offline-import-panel {
  overflow: hidden;
  padding: 0 !important;
}

#page-offline-import .offline-import-panel-head {
  border-bottom: 1px solid #edf3fb;
}

#page-offline-import .offline-import-panel .table-wrap {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#page-offline-import .offline-import-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-offline-import .offline-import-empty-cell strong,
#page-offline-import .offline-import-empty-cell span {
  display: block;
}

#page-offline-import .offline-import-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-offline-import .offline-import-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1280px) {
  .mytask-kpi-grid,
  #page-my-tasks .mytask-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .mytask-hero,
  .mytask-filter,
  .mytask-date-filter,
  .mytask-search,
  .mytask-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mytask-search input {
    width: 100%;
  }

  .mytask-kpi-grid,
  #page-my-tasks .mytask-kpi-grid {
    grid-template-columns: 1fr;
  }

  .offline-import-hero,
  .offline-import-config,
  .offline-import-panel-head,
  .offline-import-form {
    align-items: flex-start;
    flex-direction: column;
    grid-template-columns: 1fr;
  }
}

/* ========== 已完成任务 · 完成分析台 ========== */
#page-completed {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

.completed-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.completed-tabs,
.completed-hero,
.completed-filter,
.completed-kpi,
.completed-chart-card,
.completed-top-card,
.completed-toolbar {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.045);
}

.completed-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  overflow-x: auto;
}

.completed-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.completed-tabs button:hover,
.completed-tabs button.active,
.completed-tabs button[aria-current="page"] {
  border-color: rgb(22 119 255 / 0.35) !important;
  background: linear-gradient(90deg, #eaf4ff, #ffffff) !important;
  color: #1677ff !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.14), 0 8px 20px rgb(22 119 255 / 0.08) !important;
  font-weight: 850 !important;
}

#page-completed .completed-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

#page-completed .completed-kpi.kpi-filter-btn,
#page-completed .completed-kpi.kpi-stat-only {
  display: block;
  border-radius: 24px !important;
  border-bottom: 3px solid var(--completed-kpi-color, #1677ff);
}

.completed-hero,
.completed-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.completed-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 780;
}

.completed-hero p {
  margin: 6px 0 0;
  color: #7b8798;
  font-size: 13px;
}

.completed-filter {
  padding: 12px 14px;
}

.completed-date-filter,
.completed-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.completed-date-filter span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.completed-filter input,
.completed-toolbar input,
.completed-toolbar select {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.completed-search input {
  width: min(360px, 38vw);
  border-radius: 999px;
}

.completed-filter input:focus,
.completed-toolbar input:focus,
.completed-toolbar select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1);
}

.completed-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.completed-kpi {
  position: relative;
  min-height: 112px;
  padding: 18px 18px 16px 64px;
  border-bottom: 3px solid var(--completed-kpi-color, #1677ff);
}

.completed-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--completed-kpi-bg, #eef6ff);
}

.completed-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--completed-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

.completed-kpi span,
.completed-kpi small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

.completed-kpi strong {
  display: block;
  margin: 10px 0 6px;
  color: #172033;
  font-size: 28px;
  line-height: 1;
}

.completed-kpi-blue { --completed-kpi-color: #1677ff; --completed-kpi-bg: #e8f3ff; }
.completed-kpi-green { --completed-kpi-color: #16a34a; --completed-kpi-bg: #ecfdf3; }
.completed-kpi-red { --completed-kpi-color: #ef4444; --completed-kpi-bg: #fff1f2; }
.completed-kpi-orange { --completed-kpi-color: #f59e0b; --completed-kpi-bg: #fff7e6; }
.completed-kpi-purple { --completed-kpi-color: #8b5cf6; --completed-kpi-bg: #f5f3ff; }

.completed-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
  gap: 14px;
}

.completed-chart-card,
.completed-top-card {
  padding: 16px;
}

.completed-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #172033;
  font-size: 14px;
}

.completed-card-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.completed-trend {
  min-height: 250px;
}

.completed-trend-svg {
  width: 100%;
  height: 250px;
}

.completed-trend-svg text {
  fill: #94a3b8;
  font-size: 11px;
}

.completed-axis {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.completed-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.completed-line-total {
  stroke: #1677ff;
}

.completed-line-pass {
  stroke: #16a34a;
}

.completed-top-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.completed-top-list th,
.completed-top-list td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
}

.completed-top-list th {
  color: #64748b;
  background: #fbfdff;
  font-weight: 800;
}

.completed-top-list td {
  color: #334155;
}

.completed-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.completed-toolbar input {
  flex: 1;
  min-width: 220px;
}

.task-cards.completed-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.completed-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.completed-task-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.completed-task-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1677ff;
}

.completed-task-section-danger .completed-task-section-dot { background: #ef4444; }
.completed-task-section-muted .completed-task-section-dot { background: #94a3b8; }

.completed-task-section-head strong {
  flex: 1;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.completed-task-section-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

body.layout-pro .task-cards.completed-cards .task-card,
.task-cards.completed-cards .task-card {
  position: relative;
  min-height: 190px;
  padding: 14px 15px;
  border: 1px solid #e6edf5;
  border-left: 3px solid var(--completed-card-accent, #16a34a);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.045);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}

.task-cards.completed-cards .task-card:hover {
  transform: translateY(-2px);
  border-color: rgb(22 119 255 / 0.26);
  box-shadow: 0 16px 34px rgb(15 23 42 / 0.09);
}

.completed-card-pass { --completed-card-accent: #16a34a; }
.completed-card-fail { --completed-card-accent: #ef4444; }

.task-cards.completed-cards .task-card-top {
  margin-bottom: 12px;
}

.task-cards.completed-cards .task-card-badges {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.task-cards.completed-cards .task-card-subline {
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.45;
}

.task-cards.completed-cards .task-card-progress {
  margin-top: 10px;
}

.task-cards.completed-cards .task-card-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.task-cards.completed-cards .task-card-progress-head strong {
  color: #64748b;
  font-size: 11px;
}

.task-cards.completed-cards .task-card-progress-track {
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.task-cards.completed-cards .task-card-progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #1677ff;
}

.completed-card-pass .task-card-progress-track span { background: #16a34a; }
.completed-card-fail .task-card-progress-track span { background: #ef4444; }

.task-cards.completed-cards .task-card-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.task-cards.completed-cards .task-card-info {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.task-cards.completed-cards .task-card-info span {
  display: block;
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.task-cards.completed-cards .task-card-info strong {
  display: block;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-cards.completed-cards .task-card-title {
  color: #172033;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.task-cards.completed-cards .task-card-meta {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 6px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.task-cards.completed-cards .task-card-meta span {
  margin: 0;
  color: #94a3b8;
}

.task-cards.completed-cards .task-card-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.task-cards.completed-cards .btn-icon {
  min-width: 26px;
  height: 24px;
  border: 1px solid #edf2f7;
  border-radius: 999px;
  background: #fff;
  color: #94a3b8;
  font-size: 12px;
}

.completed-empty {
  grid-column: 1 / -1;
  text-align: center;
}

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

  .completed-analytics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .completed-hero,
  .completed-filter,
  .completed-date-filter,
  .completed-search {
    align-items: flex-start;
    flex-direction: column;
  }

  .completed-search input {
    width: 100%;
  }

  .completed-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* 金蝶中间库同步中心 */
.k3sync-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.k3sync-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 90% 10%, rgb(22 119 255 / 0.14), transparent 18rem),
    linear-gradient(135deg, #f7fbff 0%, #fff 58%, #eef6ff 100%);
  border: 1px solid #d7e8ff;
}

.k3sync-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.k3sync-hero h2 {
  margin: 0 0 8px;
  color: #0f2747;
  font-size: 24px;
}

.k3sync-hero p {
  max-width: 760px;
  margin: 0;
  color: #5c6f86;
}

.k3sync-actions,
.k3sync-command,
.k3sync-panel-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.k3sync-command {
  padding: 14px 16px;
}

.k3sync-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.k3sync-card {
  padding: 16px;
  border: 1px solid #dbeafe;
  box-shadow: 0 10px 24px rgb(15 65 130 / 0.06);
}

.k3sync-card span {
  color: #53657a;
  font-weight: 700;
}

.k3sync-card strong {
  display: block;
  margin-top: 8px;
  color: #12345c;
  font-family: var(--mono);
  font-size: 28px;
}

.k3sync-card small {
  display: block;
  min-height: 34px;
  margin-top: 4px;
  color: #7b8b9f;
}

.k3sync-card-tags {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.k3sync-card-tags b {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.k3sync-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px;
}

.k3sync-panel {
  padding: 16px;
}

.k3sync-panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.k3sync-panel-head h3 {
  margin: 0;
  color: #102a43;
}

.k3sync-panel-head p {
  margin: 4px 0 0;
  color: #718096;
  font-size: 13px;
}

.k3sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.k3sync-badge-success,
.k3sync-badge-pass {
  background: #dcfce7;
  color: #15803d;
}

.k3sync-badge-failed,
.k3sync-badge-fail,
.k3sync-badge-return {
  background: #fee2e2;
  color: #b91c1c;
}

.k3sync-badge-pending,
.k3sync-badge-writing,
.k3sync-badge-mixed {
  background: #fff7ed;
  color: #c2410c;
}

.k3sync-error {
  grid-column: 1 / -1;
  padding: 16px;
  color: #b91c1c;
}

/* 金蝶中间库同步中心 · Kingdee Sync Command Center */
#page-kingdee-sync {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-kingdee-sync .k3sync-page {
  width: 100%;
  max-width: none;
  align-items: stretch;
  box-sizing: border-box;
}

#page-kingdee-sync .k3sync-hero,
#page-kingdee-sync .k3sync-command,
#page-kingdee-sync .k3sync-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-kingdee-sync .k3sync-hero {
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-kingdee-sync .k3sync-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-kingdee-sync .k3sync-hero > * {
  position: relative;
  z-index: 1;
}

#page-kingdee-sync .k3sync-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
}

#page-kingdee-sync .k3sync-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-kingdee-sync .k3sync-hero h2 {
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-kingdee-sync .k3sync-hero p,
#page-kingdee-sync .k3sync-panel-head p {
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-kingdee-sync .k3sync-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-kingdee-sync .k3sync-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-kingdee-sync .k3sync-command {
  padding: 18px !important;
}

#page-kingdee-sync .k3sync-command-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-kingdee-sync .k3sync-command-head strong,
#page-kingdee-sync .k3sync-panel-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-kingdee-sync .k3sync-command-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-kingdee-sync .k3sync-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn {
  position: relative;
  min-height: 122px;
  padding: 16px 16px 14px 58px !important;
  border-radius: 24px !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn:not(.is-active) {
  border: 1px solid var(--ai-line) !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

button.k3sync-card.kpi-filter-btn {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn strong {
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-kingdee-sync .k3sync-card-dot {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--k3-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
  pointer-events: none;
}

#page-kingdee-sync .k3sync-card::before {
  content: none;
  display: none;
}

#page-kingdee-sync .k3sync-card-k3_m_supplier,
#page-kingdee-sync .k3sync-card-k3_t_work_order { --k3-kpi-color: #22c55e; }
#page-kingdee-sync .k3sync-card-k3_m_customer,
#page-kingdee-sync .k3sync-card-k3_t_delivery { --k3-kpi-color: #8b5cf6; }
#page-kingdee-sync .k3sync-card-k3_t_receive { --k3-kpi-color: #f59e0b; }
#page-kingdee-sync .k3sync-card-write_back { --k3-kpi-color: #ef4444; }

#page-kingdee-sync .k3sync-card-k3_m_material { --k3-kpi-color: #1677ff; }

#page-kingdee-sync .k3sync-card-title,
#page-kingdee-sync .k3sync-card small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-kingdee-sync .k3sync-card strong {
  margin: 4px 0;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-kingdee-sync .k3sync-card-tags b {
  border: 1px solid rgb(47 125 255 / 0.10);
  background: #f4f8ff;
  color: var(--ai-blue);
  font-weight: 900;
}

#page-kingdee-sync .k3sync-panel {
  overflow: hidden;
  padding: 0 !important;
}

#page-kingdee-sync .k3sync-panel-head {
  margin-bottom: 0;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf3fb;
}

#page-kingdee-sync .k3sync-panel-head h3 {
  margin-top: 4px;
  color: var(--ai-text);
  font-weight: 950;
}

#page-kingdee-sync .k3sync-panel .table-wrap {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#page-kingdee-sync .k3sync-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-kingdee-sync .k3sync-empty-cell strong,
#page-kingdee-sync .k3sync-empty-cell span {
  display: block;
}

#page-kingdee-sync .k3sync-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 1180px) {
  .k3sync-grid,
  .k3sync-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .k3sync-hero,
  .k3sync-panels {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .k3sync-grid {
    grid-template-columns: 1fr;
  }
}

/* 检验方案匹配规则 */
.itr-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.itr-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
}

.itr-eyebrow {
  margin: 0 0 6px;
  color: #1677ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.itr-hero h2 {
  margin: 0 0 8px;
  color: #102a43;
}

.itr-hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.itr-actions,
.itr-form-actions,
.itr-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.itr-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
}

.itr-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.itr-form input,
.itr-form select,
.itr-filter input,
.itr-filter select {
  min-height: 34px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.itr-notes {
  grid-column: span 2;
}

.itr-form-hint {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  line-height: 1.5;
  font-size: 13px;
}

/* 自动匹配方案 · 绑定弹窗 */
#itr-edit-modal .itr-edit-modal-panel {
  max-width: min(640px, 96vw);
}

#itr-edit-modal .itr-edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px 18px;
}

#itr-edit-modal .itr-form-hint {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e8eef6;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

#itr-edit-modal .itr-edit-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#itr-edit-modal .itr-edit-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

#itr-edit-modal .itr-edit-field > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

#itr-edit-modal .itr-edit-field--wide {
  grid-column: 1 / -1;
}

#itr-edit-modal .itr-edit-field--status {
  max-width: 180px;
}

#itr-edit-modal .itr-edit-field--priority {
  max-width: 180px;
}

#itr-edit-modal .itr-edit-field--priority em {
  font-style: normal;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

#itr-edit-modal .itr-edit-field input,
#itr-edit-modal .itr-edit-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 0 11px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}

#itr-edit-modal .itr-edit-field input:focus,
#itr-edit-modal .itr-edit-field select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

#itr-edit-modal .itr-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid #eef2f6;
}

.itr-advanced {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.itr-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: #f8fafc;
}

.itr-advanced-summary::-webkit-details-marker,
.itr-advanced-summary::marker {
  display: none;
  content: '';
}

.itr-advanced[open] .itr-advanced-summary {
  border-bottom: 1px solid #eef2f6;
  background: #fff;
}

.itr-advanced-summary-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.itr-advanced-summary-main strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}

.itr-advanced-summary-main small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.itr-advanced-chevron {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  position: relative;
}

.itr-advanced-chevron::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.itr-advanced[open] .itr-advanced-chevron::before {
  top: 12px;
  transform: rotate(225deg);
}

.itr-advanced-summary:hover .itr-advanced-chevron {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.itr-advanced-body {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #fafbfc;
}

.itr-advanced-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  background: #fff;
}

.itr-advanced-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.itr-advanced-block-head span {
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.itr-advanced-block-head small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.itr-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.itr-advanced-grid .itr-notes {
  grid-column: 1 / -1;
}

.itr-combo-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.itr-combo-wrap > input {
  width: 100%;
  box-sizing: border-box;
}

.itr-combo-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(15 43 92 / 0.12);
}

.itr-combo-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.itr-combo-item:hover,
.itr-combo-item[aria-selected='true'] {
  background: #eff6ff;
}

.itr-combo-item strong {
  font-size: 12px;
  color: #0f172a;
  font-weight: 650;
}

.itr-combo-item small {
  font-size: 11px;
  color: #64748b;
}

.itr-template-option {
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.itr-template-option + .itr-template-option {
  margin-top: 2px;
}

.itr-template-option:hover,
.itr-template-option[aria-selected='true'] {
  border-color: #bfdbfe;
}

.itr-template-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.itr-template-option-head strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.itr-template-option-lane {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 10px;
  font-weight: 700;
}

.itr-template-option-meta,
.itr-template-option-code {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
}

.itr-combo-item--empty {
  cursor: default;
  color: #94a3b8;
  font-size: 12px;
}

.itr-combo-item--empty:hover {
  background: transparent;
}

.itr-combo-loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: itr-combo-spin 0.7s linear infinite;
}

.itr-combo-more {
  position: sticky;
  bottom: -6px;
  margin: 6px -6px -6px;
  padding: 9px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

@keyframes itr-combo-spin {
  to { transform: rotate(360deg); }
}

.itr-form-actions {
  align-self: end;
}

.mdm-template-code-reservation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  min-width: 0;
}

.mdm-template-code-reservation > input {
  min-width: 0;
  width: 100%;
  color: #1d4ed8;
  background: #eff6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.iqc-entity-combo {
  position: relative;
  display: block;
  min-width: 0;
}

.iqc-entity-combo__input {
  width: 100%;
  box-sizing: border-box;
}

.iqc-entity-combo__list {
  position: absolute;
  z-index: 120;
  top: calc(100% + 5px);
  left: 0;
  width: min(520px, calc(100vw - 48px));
  max-height: 360px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgb(15 23 42 / 0.18);
}

#iqc-bf-supplier-wrap .iqc-entity-combo__list {
  width: min(420px, calc(100vw - 48px));
}

.iqc-order-combo__list {
  width: min(540px, calc(100vw - 48px));
}

.iqc-order-option {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.iqc-order-option__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.iqc-order-option__head strong {
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.iqc-order-option__meta,
.iqc-order-option__materials {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.iqc-order-option__materials {
  overflow: hidden;
  color: #7c8799;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iqc-entity-combo__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #334155;
  cursor: pointer;
}

.iqc-entity-combo__item:hover,
.iqc-entity-combo__item[aria-selected='true'] {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.iqc-entity-combo__item--empty {
  justify-content: flex-start;
  color: #94a3b8;
  cursor: default;
}

.iqc-entity-combo__item--empty:hover {
  border-color: transparent;
  background: transparent;
}

.iqc-entity-combo__item--product {
  display: block;
  padding: 10px 12px;
}

.iqc-entity-combo__tag {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 10px;
  font-weight: 700;
}

.iqc-entity-combo__tag--avl {
  color: #047857;
  background: #d1fae5;
}

.iqc-entity-combo__tag--order {
  color: #1d4ed8;
  background: #dbeafe;
}

.iqc-product-option {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.iqc-product-option__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.iqc-product-option__head strong {
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.iqc-product-option__name {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.iqc-product-option__name small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}

.iqc-product-option__meta,
.iqc-product-option__context {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.iqc-product-option__context {
  color: #7c8799;
}

.iqc-entity-combo__more {
  position: sticky;
  bottom: -6px;
  margin: 6px -6px -6px;
  padding: 9px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

.iqc-entity-combo__loading::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: itr-combo-spin 0.7s linear infinite;
}

.iqc-product-selected {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #f8fbff;
}

.iqc-product-selected__label {
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
}

.iqc-product-selected .iqc-product-option__context,
.iqc-product-selected .iqc-product-option__name small {
  display: none;
}

@media (max-width: 760px) {
  .itr-advanced-grid,
  #itr-edit-modal .itr-edit-primary {
    grid-template-columns: 1fr;
  }

  #itr-edit-modal .itr-edit-field--status,
  #itr-edit-modal .itr-edit-field--priority {
    max-width: none;
  }
}

.itr-filter {
  padding: 12px 14px;
}

.itr-filter input {
  min-width: 320px;
}

.itr-table-wrap {
  padding: 0;
}

.itr-table-wrap .data-table td small {
  color: #94a3b8;
}

@media (max-width: 1180px) {
  .itr-form {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .itr-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .itr-form {
    grid-template-columns: 1fr;
  }

  .itr-notes,
  .itr-filter input {
    grid-column: auto;
    min-width: 100%;
  }
}

/* ========== 全系统 · AI Native 工业 SaaS 统一视觉层 ========== */
:root {
  --ai-bg: #f5f7fb;
  --ai-card: rgb(255 255 255 / 0.96);
  --ai-card-strong: #ffffff;
  --ai-line: #e5edf7;
  --ai-line-strong: #d8e4f2;
  --ai-blue: #2563eb;
  --ai-electric: #2f7dff;
  --ai-cyan: #22d3ee;
  --ai-purple: #8b5cf6;
  --ai-mint: #35d399;
  --ai-text: #111827;
  --ai-sub: #4b5d72;
  --ai-muted: #7c8aa0;
  --ai-soft: #f8fbff;
  --ai-radius-card: 24px;
  --ai-radius-panel: 28px;
  --ai-shadow-card: 0 14px 34px rgb(15 43 92 / 0.07);
  --ai-shadow-hover: 0 22px 48px rgb(15 43 92 / 0.11);
  --ai-glow: 0 0 0 1px rgb(47 125 255 / 0.06), 0 18px 52px rgb(47 125 255 / 0.12);
}

body.layout-erp,
body.layout-pro {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.12), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgb(139 92 246 / 0.09), transparent 24rem),
    linear-gradient(180deg, #f8fbff 0%, var(--ai-bg) 44%, #f6f8fc 100%);
}

.erp-body,
.app-main,
.page {
  background:
    radial-gradient(circle at 8% 0%, rgb(34 211 238 / 0.06), transparent 24rem),
    linear-gradient(180deg, rgb(248 251 255 / 0.94), rgb(245 247 251 / 0.96));
}

.app-page-head {
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-panel);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(232 243 255 / 0.86)),
    radial-gradient(circle at 92% 0%, rgb(47 125 255 / 0.14), transparent 14rem);
  box-shadow: var(--ai-shadow-card);
}

.app-page-head-icon {
  border-radius: 18px;
  background: linear-gradient(135deg, #eaf4ff, #ffffff);
  color: var(--ai-blue);
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.16), 0 10px 28px rgb(47 125 255 / 0.12);
}

.app-page-title {
  color: var(--ai-text);
  font-weight: 860;
  letter-spacing: -0.03em;
}

.app-page-desc {
  color: var(--ai-sub);
}

.card,
.compact-help-details,
.table-wrap,
.filter-row,
.form-row,
.modal-content,
.drawer-panel,
.prod-hero,
.prod-kpi,
.prod-scan-strip,
.prod-archive-aside,
.prod-archive-toolbar,
.prod-quick-add,
#page-products .filter-row,
.prod-archive-table-wrap,
.prod-archive-pagination,
.qod-card,
.qod-command-strip,
.entry-hero,
.entry-date-row,
.entry-search-panel,
.entry-panel-modern,
.entry-feature-card,
.ct-hero,
.ct-section,
.ct-footer-actions,
.tq-hero,
.tq-tabs,
.tq-filter-panel,
.of-surface-card,
.of-board-filter,
.of-flow-steps,
.mdmp-hero,
.mdmp-date-row,
.mdmp-filter-panel,
.mdmp-create-panel,
.mdmp-category-side,
.mdmp-template-table-wrap,
.pcc-hero,
.pcc-filter-panel,
.pcc-create-panel,
.pcc-table-card,
.itr-hero,
.itr-form-card,
.itr-filter,
.itr-table-wrap {
  border-color: var(--ai-line) !important;
  border-radius: var(--ai-radius-card) !important;
  background: var(--ai-card) !important;
  box-shadow: var(--ai-shadow-card) !important;
}

.prod-hero,
.qod-hero,
.entry-hero,
.ct-hero,
.tq-hero,
.order-flow-hero,
.mdmp-hero,
.pcc-hero,
.itr-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-panel) !important;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(232 243 255 / 0.9)),
    radial-gradient(circle at 92% 8%, rgb(47 125 255 / 0.15), transparent 15rem),
    radial-gradient(circle at 8% 100%, rgb(139 92 246 / 0.1), transparent 16rem) !important;
  box-shadow: var(--ai-glow) !important;
}

.prod-hero::before,
.entry-hero::before,
.ct-hero::before,
.tq-hero::before,
.order-flow-hero::before,
.mdmp-hero::before,
.pcc-hero::before,
.itr-hero::before {
  content: 'AI Native Console';
  position: absolute;
  right: 20px;
  top: 18px;
  padding: 6px 11px;
  border: 1px solid rgb(47 125 255 / 0.14);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.72);
  color: #0756d8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mdmp-hero {
  padding-right: 184px !important;
}

.mdmp-hero::before {
  top: auto;
  right: 22px;
  bottom: 18px;
  pointer-events: none;
}

.mdmp-hero-actions {
  position: relative;
  z-index: 2;
}

.btn,
button:not(.kpi-filter-btn):not(.prod-kpi-button) {
  border-radius: 999px;
}

.btn-primary,
button.btn-primary,
.primary-btn {
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--ai-blue), var(--ai-electric)) !important;
  color: #fff !important;
  box-shadow: 0 10px 26px rgb(22 119 255 / 0.22);
  font-weight: 850;
}

.btn-ghost,
button.btn-ghost {
  border-color: var(--ai-line) !important;
  background: rgb(255 255 255 / 0.72) !important;
  color: var(--ai-sub) !important;
  font-weight: 780;
}

.btn:hover,
button:hover,
.card:hover,
.prod-kpi:hover,
.qod-kpi:hover,
.mdmp-kpi:hover,
.pcc-kpi:hover {
  transform: translateY(-1px);
}

input,
select,
textarea,
.prod-toolbar-filters input,
.prod-toolbar-filters select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  border-color: var(--ai-line-strong) !important;
  border-radius: 16px !important;
  background: #fff !important;
  color: var(--ai-text);
  min-height: 38px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgb(47 125 255 / 0.52) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1) !important;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  background: linear-gradient(180deg, #fbfdff, #f5f9ff) !important;
  color: #607089 !important;
  font-weight: 850 !important;
  border-bottom-color: var(--ai-line) !important;
}

.data-table tbody td {
  border-bottom-color: #eef3fa !important;
  color: #334155;
}

.data-table tbody tr:hover td {
  background: #f8fbff !important;
}

.badge,
.status-badge,
.of-type-pill,
.prod-iqc-badge {
  border-radius: 999px !important;
  font-weight: 850 !important;
}

.prod-kpi,
.qod-kpi,
.mdmp-kpi,
.pcc-kpi {
  border-radius: 24px !important;
  overflow: hidden;
}

.prod-kpi::after,
.qod-kpi::after,
.mdmp-kpi::after,
.pcc-kpi::after {
  opacity: 0.9;
}

.prod-archive-layout,
.mdmp-workspace,
.order-flow-zone,
.tq-page,
.ct-page,
.entry-page,
.qod-page {
  gap: 16px;
}

.erp-topnav {
  background: linear-gradient(90deg, #0f63d8, #1677ff 42%, #2f7dff) !important;
  box-shadow: 0 8px 28px rgb(22 119 255 / 0.18);
}

/* Material Intelligence Hub 专属增强 */
#page-products .prod-hero {
  min-height: 126px;
}

#page-products .prod-eyebrow::after {
  content: ' · Intelligence Hub';
  color: var(--ai-purple);
}

#page-products .prod-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

#page-products .prod-page-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
}

#page-products .prod-kpi.kpi-filter-btn {
  position: relative;
  min-height: 118px;
  padding: 18px 18px 16px 68px !important;
  border-radius: var(--ai-radius-card) !important;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(47 125 255 / 0.12), transparent 7rem) !important;
}

#page-products .prod-kpi.kpi-filter-btn.is-active::before {
  box-shadow: none !important;
}

#page-products .prod-kpi.kpi-filter-btn.is-active::after {
  left: 30px !important;
  top: 30px !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  background: var(--prod-kpi-color, var(--kpi-accent, #1677ff)) !important;
  box-shadow:
    0 0 0 4px rgb(255 255 255 / 0.88),
    0 0 16px color-mix(in srgb, var(--prod-kpi-color, var(--kpi-accent, #1677ff)) 58%, transparent) !important;
}

#page-products .prod-kpi.kpi-filter-btn > span,
#page-products .prod-kpi.kpi-filter-btn > strong {
  display: block;
  position: relative;
  z-index: 1;
}

#page-products .prod-kpi.kpi-filter-btn > span {
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-products .prod-kpi.kpi-filter-btn.is-active > span {
  color: var(--kpi-accent, #1677ff);
  font-weight: 900;
}

#page-products .prod-kpi.kpi-filter-btn > strong {
  margin: 8px 0 6px;
  line-height: 1.1;
}

#page-products .prod-kpi.kpi-filter-btn > small {
  display: block;
  position: relative;
  z-index: 1;
  margin-top: 0;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

#page-products .prod-kpi.kpi-filter-btn.is-active > small {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--kpi-accent, #1677ff);
  font-weight: 800;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent);
}

#page-products .prod-kpi.kpi-filter-btn.is-active > small::after {
  content: ' · 已筛选';
  color: var(--kpi-accent, #1677ff);
  font-weight: 700;
}

#page-products .prod-kpi.kpi-filter-btn.is-active {
  transform: none;
  z-index: auto;
}

#page-products .prod-toolbar-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(108px, 1fr)) auto auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 1500px) {
  #page-products .prod-toolbar-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #page-products .prod-toolbar-filters .prod-ai-search-input {
    grid-column: 1 / -1;
  }
}

#page-products .prod-archive-layout {
  display: grid;
  grid-template-columns: minmax(248px, 280px) minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  align-items: start;
}

#page-products .prod-archive-aside {
  grid-column: 1;
  min-width: 0;
}

#page-products .prod-archive-body {
  grid-column: 2;
  min-width: 0;
  width: 100%;
}

@media (max-width: 1280px) {
  #page-products .prod-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  #page-products .prod-archive-layout {
    grid-template-columns: 1fr;
  }

  #page-products .prod-archive-aside,
  #page-products .prod-archive-body {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  #page-products .prod-kpi-grid {
    grid-template-columns: 1fr;
  }
}

#page-products .prod-kpi-button.is-active strong {
  color: var(--prod-kpi-color, #1677ff) !important;
}

#page-products .prod-kpi strong {
  font-size: 30px;
  font-weight: 900;
}

#page-products .prod-scan-strip,
#page-products .prod-archive-toolbar,
#page-products .prod-action-grid > .card,
#page-products .prod-archive-table-wrap {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(248 251 255 / 0.96)) !important;
}

#page-products .prod-table-title {
  background:
    linear-gradient(90deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 12rem) !important;
}

#page-products .prod-type-row,
#page-products .prod-stage-chip,
#page-products .prod-shortcuts button,
#page-products .prod-scan-strip button {
  border-radius: 999px !important;
}

#page-products .prod-ai-insight-strip {
  position: relative;
  overflow: hidden;
  min-height: 70px;
  padding: 14px 18px;
  border: 1px solid rgb(47 125 255 / 0.14) !important;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.98), rgb(244 249 255 / 0.96)),
    radial-gradient(circle at 8% 50%, rgb(34 211 238 / 0.16), transparent 12rem),
    radial-gradient(circle at 96% 0%, rgb(139 92 246 / 0.12), transparent 14rem) !important;
}

#page-products .prod-ai-insight-strip::after {
  content: '';
  position: absolute;
  right: 24px;
  top: 16px;
  width: 150px;
  height: 36px;
  pointer-events: none;
  opacity: .55;
  background:
    linear-gradient(90deg, transparent, rgb(47 125 255 / 0.24), transparent),
    repeating-linear-gradient(90deg, transparent 0 14px, rgb(34 211 238 / 0.18) 14px 16px);
  border-radius: 999px;
}

#page-products .prod-ai-insight-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#page-products .prod-ai-orb {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ai-blue), var(--ai-cyan));
  box-shadow: 0 10px 28px rgb(47 125 255 / 0.22), inset 0 0 0 1px rgb(255 255 255 / 0.55);
}

#page-products .prod-ai-orb::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: #fff;
  opacity: .88;
}

#page-products .prod-ai-insight-main strong {
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

#page-products .prod-ai-insight-main small {
  margin-top: 4px;
  color: var(--ai-sub);
  font-size: 12px;
}

#page-products .prod-scan-actions {
  position: relative;
  z-index: 1;
}

#page-products .prod-scan-actions button {
  min-height: 36px;
  border-color: rgb(47 125 255 / 0.16) !important;
  background: rgb(255 255 255 / 0.78) !important;
  color: var(--ai-sub);
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.04);
}

#page-products .prod-scan-actions button:hover {
  color: var(--ai-blue);
  background: #eaf4ff !important;
}

#page-products .prod-archive-aside {
  padding: 12px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(248 251 255 / 0.96)) !important;
}

#page-products .prod-aside-section {
  padding: 13px;
  border: 1px solid var(--ai-line) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(47 125 255 / 0.08), transparent 8rem) !important;
}

#page-products .prod-aside-head {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

#page-products .prod-aside-toggle {
  border: 1px solid var(--ai-line) !important;
  background: rgb(255 255 255 / 0.9) !important;
  color: var(--ai-muted);
  font-weight: 750;
}

#page-products .prod-aside-toggle:hover {
  border-color: rgb(47 125 255 / 0.35) !important;
  color: var(--ai-blue);
  background: #eaf4ff !important;
}

#page-products .prod-aside-section.is-collapsed .prod-aside-head {
  margin-bottom: 0;
}

#page-products .prod-aside-heading {
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 900;
}

#page-products .prod-aside-sub {
  color: var(--ai-muted);
  font-size: 11px;
}

#page-products .prod-stage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-products .prod-type-nav {
  max-height: min(40vh, 320px);
}

#page-products .prod-customer-nav {
  max-height: min(36vh, 280px);
}

.prod-customer-count {
  min-width: 2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ai-muted, #64748b);
}

.prod-type-row--active .prod-customer-count {
  color: var(--ai-blue, #2563eb);
}

#page-products .prod-aside-section--partners {
  margin-top: 10px;
}

#page-products .prod-partner-tab-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

#page-products .prod-aside-section--customers {
  margin-top: 10px;
}

#page-products .prod-stage-chip {
  min-height: 34px;
  justify-content: center;
  border: 1px solid var(--ai-line) !important;
  background: rgb(255 255 255 / 0.82) !important;
  color: var(--ai-sub);
  font-weight: 850;
}

#page-products .prod-stage-chip--active {
  border-color: rgb(47 125 255 / 0.3) !important;
  background: linear-gradient(135deg, #eaf4ff, #f8fbff) !important;
  color: var(--ai-blue);
}

#page-products .prod-aside-search {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px !important;
  background: #fff !important;
}

#page-products .prod-type-nav {
  gap: 8px;
  padding: 3px;
  max-height: min(50vh, 430px);
}

#page-products .prod-type-row {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--ai-line);
  border-left: 1px solid var(--ai-line);
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.94), rgb(248 251 255 / 0.88)) !important;
  color: var(--ai-sub);
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.035);
}

#page-products .prod-type-row:hover,
#page-products .prod-type-row--active {
  border-color: rgb(47 125 255 / 0.24);
  background:
    linear-gradient(135deg, #eaf4ff, #ffffff),
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 5rem) !important;
  color: var(--ai-blue);
  box-shadow: 0 10px 22px rgb(47 125 255 / 0.08);
}

#page-products .prod-type-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c7d7ea;
  box-shadow: 0 0 0 4px rgb(199 215 234 / 0.18);
}

#page-products .prod-type-row--active .prod-type-dot {
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.14), 0 0 18px rgb(47 125 255 / 0.34);
}

#page-products .prod-type-copy {
  min-width: 0;
}

#page-products .prod-type-copy strong,
#page-products .prod-type-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-products .prod-type-copy strong {
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

#page-products .prod-type-copy small {
  margin-top: 3px;
  color: var(--ai-muted);
  font-family: var(--mono);
  font-size: 10px;
}

#page-products .prod-type-row--active .prod-type-copy strong,
#page-products .prod-type-row--active .prod-type-copy small {
  color: var(--ai-blue);
}

#page-products .prod-type-state {
  justify-self: end;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 900;
}

#page-products .prod-type-row--active .prod-type-state {
  background: var(--ai-blue);
  color: #fff;
  letter-spacing: .04em;
}

/* 全系统分类/树导航 · 智能分类卡 */
.sidebar {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.96), rgb(248 251 255 / 0.96)),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.08), transparent 16rem) !important;
  border-right-color: var(--ai-line) !important;
}

.sidebar-nav {
  padding: 8px 10px 14px;
}

/* 侧栏菜单样式已迁移至 sidebar-nav.css */

.fc-tree,
.mdmp-category-side,
.ins-sidebar,
.reporttpl-list-card,
.pcc-table-card {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(248 251 255 / 0.96)) !important;
}

.fc-tree-title,
.ins-sidebar-title,
.mdmp-panel-head h3,
.prod-aside-heading {
  color: var(--ai-text) !important;
  font-weight: 900 !important;
  letter-spacing: -0.01em;
}

.mdmp-category-nav,
.fc-tree-line-wrap,
.ins-sidebar,
.fc-tree {
  scrollbar-width: thin;
  scrollbar-color: rgb(47 125 255 / 0.22) transparent;
}

.mdmp-category-nav::-webkit-scrollbar,
.fc-tree-line-wrap::-webkit-scrollbar,
.ins-sidebar::-webkit-scrollbar,
.fc-tree::-webkit-scrollbar {
  width: 6px;
}

.mdmp-category-nav::-webkit-scrollbar-thumb,
.fc-tree-line-wrap::-webkit-scrollbar-thumb,
.ins-sidebar::-webkit-scrollbar-thumb,
.fc-tree::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(47 125 255 / 0.22);
}

.fc-tree-node,
.ins-sidebar button,
.ins-sidebar .ins-side-item {
  position: relative;
  display: grid !important;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  margin: 6px 0;
  padding: 9px 11px !important;
  border: 1px solid var(--ai-line) !important;
  border-left: 1px solid var(--ai-line) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.94), rgb(248 251 255 / 0.9)) !important;
  color: var(--ai-sub) !important;
  text-align: left;
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.035);
  transition: background .16s var(--ease-out), border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), transform .16s var(--ease-out);
}

.fc-tree-node::before,
.ins-sidebar button::before,
.ins-sidebar .ins-side-item::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c7d7ea;
  box-shadow: 0 0 0 4px rgb(199 215 234 / 0.18);
}

.fc-tree-node::after,
.ins-sidebar button::after,
.ins-sidebar .ins-side-item::after {
  content: '›';
  justify-self: end;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.fc-tree-node:hover,
.fc-tree-node-active,
.ins-sidebar button:hover,
.ins-sidebar button.active,
.ins-sidebar .ins-side-item:hover,
.ins-sidebar .active {
  border-color: rgb(47 125 255 / 0.24) !important;
  background:
    linear-gradient(135deg, #eaf4ff, #ffffff),
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 5rem) !important;
  color: var(--ai-blue) !important;
  box-shadow: 0 10px 22px rgb(47 125 255 / 0.08);
}

.fc-tree-node-active::before,
.ins-sidebar button.active::before,
.ins-sidebar .active::before {
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.14), 0 0 18px rgb(47 125 255 / 0.34);
}

.fc-tree-node-active::after,
.ins-sidebar button.active::after,
.ins-sidebar .active::after {
  content: 'Active';
  background: var(--ai-blue);
  color: #fff;
  letter-spacing: .04em;
}

.fc-tree-leaf {
  padding-left: 11px !important;
}

.fc-tree-leaf .fc-sub,
.fc-tree-node .fc-sub,
.mdmp-category-nav small,
.ins-sidebar small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ai-muted);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-tree-group {
  margin-bottom: 12px;
}

.fc-tree-line-wrap {
  margin: 8px 0 12px;
  padding-left: 0;
  border-left: 0;
}

.fc-tag-pill,
.qod-priority-item,
.qod-list-item,
.mdmp-template-toolbar button,
.pcc-toolbar button {
  border-radius: 999px !important;
}

#page-products .prod-archive-toolbar {
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.1), transparent 18rem),
    linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(248 251 255 / 0.96)) !important;
}

#page-products .prod-toolbar-head h3 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

#page-products .prod-toolbar-head p {
  color: var(--ai-sub);
  line-height: 1.55;
}

#page-products .prod-toolbar-actions .btn {
  min-height: 34px;
  border-radius: 999px !important;
  box-shadow: none;
}

#page-products .prod-toolbar-filters {
  position: relative;
  margin-top: 16px;
  padding: 18px 14px 14px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background: #f8fafc;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9);
}

#page-products .prod-toolbar-filters::before {
  content: 'AI Search Console';
  position: absolute;
  left: 16px;
  top: -10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-products .prod-toolbar-filters input,
#page-products .prod-toolbar-filters select,
#page-products .prod-ai-search-input {
  min-height: 42px;
}

#page-products .prod-toolbar-filters input,
#page-products .prod-ai-search-input {
  padding-left: 16px;
}

#page-products .prod-toolbar-filters input:focus,
#page-products .prod-toolbar-filters select:focus {
  border-color: #1677ff !important;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.14) !important;
}

#page-products .prod-ai-import--primary {
  min-height: unset;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgb(15 43 92 / 0.06) !important;
}

#page-products .prod-ai-import--primary::before {
  display: none !important;
  content: none !important;
}

#page-products .prod-more-tools .prod-quick-add {
  min-height: unset;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
}

#page-products .prod-action-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
}

#page-products .prod-quick-add,
#page-products .prod-ai-import {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  border-radius: 24px !important;
  border-color: rgb(47 125 255 / 0.13) !important;
  box-shadow: 0 14px 30px rgb(15 43 92 / 0.06);
}

#page-products .prod-quick-add::before,
#page-products .prod-ai-import::before {
  content: '';
  position: absolute;
  right: -26px;
  top: -34px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.08);
}

#page-products .prod-ai-import::before {
  background: rgb(139 92 246 / 0.1);
}

#page-products .prod-action-copy {
  position: relative;
  z-index: 1;
}

#page-products .prod-action-copy strong {
  font-size: 15px;
  font-weight: 900;
}

#page-products .prod-action-copy small {
  color: var(--ai-sub);
  line-height: 1.5;
}

#page-products .prod-quick-add input,
#page-products .prod-ai-import input[type='file'] {
  position: relative;
  z-index: 1;
  min-height: 42px;
}

#page-products .prod-ai-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#page-products .prod-ai-settings {
  margin-top: -4px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

#page-products .prod-ai-settings-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
}

#page-products .prod-ai-settings-summary::-webkit-details-marker {
  display: none;
}

#page-products .prod-ai-settings-summary::before {
  content: '▸';
  color: #64748b;
  margin-right: 4px;
}

#page-products .prod-ai-settings[open] .prod-ai-settings-summary::before {
  content: '▾';
}

#page-products .prod-ai-settings-body {
  padding: 0 16px 16px;
  border-top: 1px solid #e2e8f0;
}

#page-products .prod-ai-settings-toggle {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  cursor: pointer;
}

#page-products .prod-ai-settings-toggle input {
  margin-right: 8px;
}

#page-products .prod-ai-settings-toggle small {
  color: #64748b;
  font-size: 12px;
  padding-left: 22px;
}

#page-products .prod-ai-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

#page-products .prod-ai-settings-grid label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

#page-products .prod-ai-settings-grid label > span {
  font-weight: 600;
  color: #334155;
}

#page-products .prod-ai-settings-grid select,
#page-products .prod-ai-settings-grid input[type='text'] {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

#page-products .prod-ai-model-env-hint {
  color: #64748b;
  font-size: 11px;
}

#page-products .prod-ai-settings-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.prod-ai-debug-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgb(245 158 11 / 0.35);
  background: rgb(255 251 235 / 0.95);
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.prod-ai-result-table .prod-ai-error-cell {
  min-width: 180px;
  max-width: 320px;
}

.prod-ai-result-table {
  min-width: 960px;
  table-layout: auto;
}

.prod-ai-result-table th:nth-child(2),
.prod-ai-result-table td:nth-child(2) {
  width: 76px;
  min-width: 76px;
}

.prod-ai-result-table th:nth-child(4),
.prod-ai-result-table td:nth-child(4) {
  width: 100px;
  min-width: 100px;
}

.prod-ai-result-table td:nth-child(2),
.prod-ai-result-table td:nth-child(4) {
  white-space: nowrap;
  vertical-align: middle;
}

.data-table .table-status-badge,
.prod-ai-result-table .badge {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
  vertical-align: middle;
}

.prod-ai-error-text {
  display: block;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  white-space: normal;
}

.prod-ai-debug-row td {
  padding-top: 0 !important;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
}

.prod-ai-debug-details {
  margin: 4px 0 10px;
}

.prod-ai-debug-details > summary {
  cursor: pointer;
  color: #1677ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.prod-ai-debug-panel {
  margin-top: 10px;
}

.prod-ai-debug-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 14px;
  margin: 0 0 12px;
}

.prod-ai-debug-meta div {
  min-width: 0;
}

.prod-ai-debug-meta dt {
  margin: 0 0 2px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prod-ai-debug-meta dd {
  margin: 0;
  color: #172033;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.prod-ai-debug-raw-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.prod-ai-debug-raw-head strong {
  font-size: 12px;
  color: #172033;
}

.prod-ai-debug-raw-head small {
  color: #64748b;
  font-size: 11px;
}

.prod-ai-debug-filtered {
  width: 100%;
  margin: 0 0 12px;
  border-collapse: collapse;
  font-size: 12px;
}
.prod-ai-debug-filtered th,
.prod-ai-debug-filtered td {
  padding: 6px 8px;
  border: 1px solid #dbeafe;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}
.prod-ai-debug-filtered th {
  background: #eff6ff;
  color: #334155;
  font-weight: 700;
}
.prod-ai-debug-filtered td:nth-child(2) {
  white-space: nowrap;
}

.prod-ai-debug-raw {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #dbeafe;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-model-history-advanced {
  margin-top: 12px;
  border-color: var(--ai-line, #e6edf7) !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, #fbfdff, #f8fbff) !important;
  box-shadow: none !important;
}

.ai-model-history-advanced-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.ai-model-history-advanced-summary::-webkit-details-marker {
  display: none;
}

.ai-model-history-advanced-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-model-history-advanced-title strong {
  color: var(--ai-text, #172033);
  font-size: 14px;
  font-weight: 900;
}

.ai-model-history-advanced-summary .hint {
  margin: 0;
  max-width: 520px;
  font-size: 12px;
}

.ai-model-history-advanced[open] .ai-model-history-advanced-summary {
  border-bottom: 1px solid #edf2f7;
}

.ai-model-history-advanced-body {
  padding: 14px 18px 18px;
}

.ai-model-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-model-history-toolbar #ai-model-history-q {
  flex: 1;
  min-width: 220px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #dfe7f1;
  border-radius: 10px;
  font-size: 12px;
}

.ai-model-history-table-wrap {
  border: 1px solid #edf2f7;
  border-radius: 14px;
  overflow: auto;
}

.ai-model-history-wrap {
  margin-top: 16px;
}

.ai-model-history-wrap .ai-review-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-model-history-wrap #ai-model-history-q {
  min-width: 220px;
}

.ai-model-response-inline {
  margin: 8px 0 12px;
}

.ai-model-response-details > summary {
  cursor: pointer;
  font-weight: 600;
  color: #1d4ed8;
}

.ai-model-response-body {
  margin-top: 10px;
}

.ai-model-response-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ai-model-response-modal.hidden {
  display: none;
}

.ai-model-response-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.ai-model-response-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  margin: 0;
}

.ai-model-response-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ai-model-response-modal-body .prod-ai-debug-raw {
  max-height: 420px;
}

.ai-model-pdf-excerpt {
  margin-top: 12px;
}

.ai-model-pdf-excerpt > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

#page-products .prod-ai-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

#page-products .prod-ai-progress-head strong {
  display: block;
  font-size: 15px;
  margin: 2px 0 4px;
}

#page-products .prod-ai-progress-head small {
  color: #64748b;
  font-size: 12px;
}

#page-products .prod-ai-progress-pct {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
  line-height: 1;
}

#page-products .prod-ai-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 12px;
}

#page-products .prod-ai-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.35s ease;
}

#page-products .prod-ai-progress-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #64748b;
  font-size: 12px;
}

#page-products .prod-ai-progress-steps .is-active {
  color: #1d4ed8;
  font-weight: 600;
}

#page-products .prod-ai-progress-steps .is-done {
  color: #15803d;
}

#page-products .btn.is-busy {
  opacity: 0.72;
  cursor: not-allowed;
}

#page-products .prod-action-grid .btn-primary {
  position: relative;
  z-index: 1;
  min-height: 38px;
}

#page-products .prod-table-title {
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ai-line);
}

#page-products .prod-table-title h3 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

#page-products .prod-table-insight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  padding: 7px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#page-products .prod-table-insight i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

#page-products .prod-archive-table {
  border-spacing: 0;
}

#page-products .prod-archive-table thead th {
  padding: 13px 12px;
  border-bottom: 1px solid rgb(47 125 255 / 0.12);
  background:
    linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #52627a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

#page-products .prod-archive-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
}

#page-products .prod-archive-table tbody tr {
  transition: background .16s var(--ease-out), box-shadow .16s var(--ease-out), transform .16s var(--ease-out);
}

#page-products .prod-archive-table tbody tr:hover td {
  background:
    linear-gradient(90deg, rgb(234 244 255 / 0.76), rgb(255 255 255 / 0.94)) !important;
}

#page-products .prod-code-token {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--ai-blue) !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

#page-products .prod-row-link,
#page-products .prod-row-name-link {
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

#page-products .prod-row-link {
  width: fit-content;
}

#page-products .prod-row-name-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  background: transparent;
}

#page-products .prod-row-link:hover,
#page-products .prod-row-name-link:hover strong {
  color: #0958d9 !important;
  text-decoration: underline;
}

#page-products .prod-name-cell strong {
  color: var(--ai-text);
  font-size: 13px;
}

#page-products .prod-name-cell small,
#page-products .prod-kind-cell small {
  color: var(--ai-muted);
  line-height: 1.5;
}

#page-products .prod-status-badge,
#page-products .prod-soft-pill,
#page-products .prod-attr-badge,
#page-products .prod-kind-chip,
#page-products .prod-iqc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px !important;
  font-size: 11px;
  font-weight: 900 !important;
  line-height: 1;
  white-space: nowrap;
}

#page-products .prod-soft-pill,
#page-products .prod-attr-badge,
#page-products .prod-kind-chip {
  border: 1px solid rgb(47 125 255 / 0.12);
  background: #f6f9ff;
  color: var(--ai-sub);
}

#page-products .prod-kind-chip {
  color: var(--ai-blue);
  background: #eef6ff;
}

#page-products .prod-iqc-badge b {
  font-size: 10px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

#page-products .prod-iqc-badge.is-ok {
  border: 1px solid rgb(22 163 74 / 0.18);
  background: linear-gradient(90deg, #ecfdf3, #ffffff);
  color: #047857;
}

#page-products .prod-iqc-badge.is-missing {
  border: 1px solid rgb(245 158 11 / 0.2);
  background: linear-gradient(90deg, #fff7e6, #ffffff);
  color: #b45309;
}

#page-products .prod-row-actions {
  white-space: nowrap;
}

#page-products .qcos-op-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: none !important;
  border-radius: 0 !important;
}

#page-products .qcos-op-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

#page-products .qcos-op-link + .qcos-op-link {
  margin-left: 12px;
}

#page-products .qcos-op-link--danger {
  color: #9ca3af;
}

#page-products .qcos-op-link--danger:hover {
  color: #b91c1c;
  text-decoration: underline;
}

#page-products .prod-toolbar-actions .qcos-op-link {
  min-height: 34px;
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 500;
}

#page-products .prod-row-actions .btn,
#page-products .prod-row-actions .btn-delete {
  min-height: auto;
  padding: 0;
  border-radius: 0 !important;
  font-size: 12.5px;
  font-weight: 500;
}

#page-products .prod-action-edit {
  border-color: transparent !important;
  background: transparent !important;
  color: #2563eb !important;
}

#page-products .prod-action-danger {
  border: none;
  background: none;
  color: #9ca3af;
}

#page-products .prod-action-danger:hover {
  color: #b91c1c;
  background: none;
}

#page-products .prod-archive-help {
  display: none;
}

/* Command Center 最终优先级加固：覆盖文件后段旧表格/卡片规则 */
#page-entry .entry-search-panel,
#page-create-task .ct-main-card,
#page-create-task .ct-side-card,
#page-task-query .tq-filter-panel,
#page-task-query .tq-results-workspace,
#page-task-query .tq-task-grid .task-card,
#page-completed .completed-filter,
#page-completed .completed-cards .task-card,
#page-ai-review .ai-review-filter,
#page-order-flow .of-board-filter,
#page-order-flow .of-surface-card,
#page-templates .fc-toolbar,
#page-templates .table-wrap,
.stats-page-toolbar,
.stats-merge-toolbar,
.stats-side-card,
.stats-merge-body {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-entry .data-table thead th,
#page-task-query .data-table thead th,
#page-completed .data-table thead th,
#page-ai-review .data-table thead th,
#page-order-flow .data-table thead th,
#page-templates .data-table thead th,
#page-stats-cpk .data-table thead th,
#page-stats-merge .data-table thead th {
  background: linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #52627a !important;
  font-weight: 900 !important;
  letter-spacing: .035em;
}

/* Parameter Standard Intelligence Hub 专属深化 */
#page-mdm-params .mdmp-filter-panel,
#page-mdm-params .mdmp-create-panel,
#page-mdm-params .mdmp-template-table-wrap,
#page-mdm-params .mdmp-category-side {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-mdm-params .mdmp-filter-panel {
  position: relative;
  gap: 12px;
  padding: 20px 16px 16px;
}

.mdmp-query-badge {
  position: absolute;
  left: 18px;
  top: -10px;
  z-index: 1;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-mdm-params .mdmp-filter-panel label {
  color: var(--ai-muted);
  font-weight: 900;
}

#page-mdm-params .mdmp-filter-panel input,
#page-mdm-params .mdmp-filter-panel select,
#page-mdm-params .mdmp-create-panel input,
#page-mdm-params .mdmp-create-panel select,
#page-mdm-params .mdmp-template-toolbar input {
  min-height: 42px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-mdm-params .mdmp-filter-panel input:focus,
#page-mdm-params .mdmp-filter-panel select:focus,
#page-mdm-params .mdmp-create-panel input:focus,
#page-mdm-params .mdmp-create-panel select:focus,
#page-mdm-params .mdmp-template-toolbar input:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

#page-mdm-params .mdmp-table-head {
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ai-line);
}

.mdmp-table-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mdmp-table-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12);
}

#page-mdm-params .mdmp-table-head h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mdmp-table-insight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 440px;
  padding: 7px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mdmp-table-insight i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

#page-mdm-params .mdmp-template-table thead th {
  padding: 13px 12px;
  background: linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #475569 !important;
  font-size: 12px;
  font-weight: 700 !important;
  letter-spacing: 0;
}

#page-mdm-params .mdmp-template-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  color: #0f172a;
  font-size: 13px;
}

#page-mdm-params .mdmp-template-table tbody tr:hover td,
#page-mdm-params .mdmp-template-table tbody tr.is-active td {
  background:
    linear-gradient(90deg, rgb(234 244 255 / 0.76), rgb(255 255 255 / 0.94)) !important;
}

.mdmp-standard-token,
.mdmp-lane-badge,
.mdmp-count-badge,
.mdmp-soft-token,
.mdmp-report-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px !important;
  font-size: 12px;
  font-weight: 700 !important;
  line-height: 1;
  white-space: nowrap;
}

.mdmp-standard-token {
  background: #eef6ff;
  color: var(--ai-blue) !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

.mdmp-lane-badge,
.mdmp-count-badge,
.mdmp-soft-token {
  border: 1px solid rgb(47 125 255 / 0.12);
  background: #f6f9ff;
  color: var(--ai-sub);
}

.mdmp-count-badge {
  color: var(--ai-blue);
  background: #eef6ff;
}

.mdmp-binding-pill {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  background: transparent;
}

.mdmp-binding-pill.is-empty {
  border-color: rgb(245 158 11 / 0.28);
  background: #fffbeb;
  color: #b45309;
}

.mdmp-binding-pill.is-bound {
  border-color: rgb(37 99 235 / 0.18);
  background: #eff6ff;
  color: #1d4ed8;
}

.mdmp-bound-products {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #fbfdff;
}

.mdmp-bound-products-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.mdmp-bound-products-head h4 {
  margin: 0;
  font-size: 14px;
  color: #172033;
}

.mdmp-bound-products-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}

.mdmp-bound-products-list {
  display: grid;
  gap: 8px;
}

.mdmp-bound-product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e8eef7;
  border-radius: 10px;
  background: #fff;
}

.mdmp-bound-product-card strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
}

.mdmp-bound-product-card small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}

.mdmp-template-toolbar select {
  min-height: 36px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}

.mdmp-report-badge.mdmp-report-ok,
.mdmp-report-ok.mdmp-report-badge {
  border: 1px solid rgb(22 163 74 / 0.18);
  background: linear-gradient(90deg, #ecfdf3, #ffffff);
  color: #047857;
}

.mdmp-report-badge.mdmp-report-missing,
.mdmp-report-missing.mdmp-report-badge {
  border: 1px solid rgb(245 158 11 / 0.2);
  background: linear-gradient(90deg, #fff7e6, #ffffff);
  color: #b45309;
}

.mdmp-report-link {
  appearance: none;
  cursor: pointer;
  font: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.mdmp-report-link:hover {
  transform: translateY(-1px);
  border-color: rgb(47 125 255 / 0.35) !important;
  box-shadow: 0 5px 14px rgb(47 125 255 / 0.13);
}

.mdmp-report-link:focus-visible {
  outline: 3px solid rgb(47 125 255 / 0.22);
  outline-offset: 2px;
}

.mdmp-template-title {
  color: var(--ai-text) !important;
  font-weight: 900 !important;
}

.mdmp-template-title:hover {
  color: var(--ai-blue) !important;
  text-decoration: none !important;
}

.mdmp-row-actions {
  white-space: nowrap;
}

.mdmp-row-actions .btn,
.mdmp-row-actions .btn-delete {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px !important;
  font-size: 12px;
  font-weight: 950 !important;
}

.mdmp-action-detail,
.mdmp-action-edit {
  border-color: rgb(47 125 255 / 0.14) !important;
  background: #eef6ff !important;
  color: var(--ai-blue) !important;
}

.mdmp-action-danger {
  border: 1px solid rgb(239 68 68 / 0.14);
  background: #fff1f2;
  color: #dc2626;
}

/* 标准库台账方案同步到其它功能模块 */
#page-inspection-rules .table-wrap,
#page-mdm-sampling .table-wrap,
#page-mdm-tags .table-wrap,
#page-mdm-product-categories .table-wrap,
#page-mdm-partners .table-wrap,
#page-mdm-status .table-wrap,
#page-templates .reporttpl-list-card,
#page-ai-review .ai-batch-table-wrap,
#page-ai-review .ai-draft-table-wrap,
#page-offline-import .table-wrap,
#page-kingdee-sync .table-wrap {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-inspection-rules .data-table thead th,
#page-mdm-sampling .data-table thead th,
#page-mdm-tags .data-table thead th,
#page-mdm-product-categories .data-table thead th,
#page-mdm-partners .data-table thead th,
#page-mdm-status .data-table thead th,
#page-offline-import .data-table thead th,
#page-kingdee-sync .data-table thead th {
  background: linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #52627a !important;
  font-weight: 950 !important;
  letter-spacing: .035em;
}

#page-inspection-rules .table-actions .btn,
#page-mdm-sampling .table-actions .btn,
#page-mdm-tags .table-actions .btn,
#page-mdm-product-categories .table-actions .btn,
#page-mdm-partners .table-actions .btn,
#page-mdm-status .table-actions .btn,
#page-offline-import .table-actions .btn,
#page-kingdee-sync .table-actions .btn {
  border-radius: 999px !important;
  font-weight: 900 !important;
}

/* Inspection Rule Intelligence Hub 专属深化 */
#page-inspection-rules .itr-form,
#page-inspection-rules .itr-filter,
#page-inspection-rules .itr-table-wrap {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-inspection-rules .itr-form {
  gap: 12px;
}

#page-inspection-rules .itr-form label {
  color: var(--ai-muted);
  font-weight: 900;
}

#page-inspection-rules .itr-form input,
#page-inspection-rules .itr-form select,
#page-inspection-rules .itr-filter input,
#page-inspection-rules .itr-filter select {
  min-height: 42px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-inspection-rules .itr-form input:focus,
#page-inspection-rules .itr-form select:focus,
#page-inspection-rules .itr-filter input:focus,
#page-inspection-rules .itr-filter select:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

/* 工序质检员 · 对齐检验方案规则页 */
#pia-edit-modal .pia-edit-modal-panel {
  max-width: min(920px, 96vw);
}

#pia-edit-modal .itr-form,
#page-process-inspectors .itr-filter,
#page-process-inspectors .itr-table-wrap {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#pia-edit-modal .pia-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px;
}

#pia-edit-modal .pia-form-primary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

#pia-edit-modal .pia-form-primary label,
#pia-edit-modal .pia-notes,
#pia-edit-modal .pia-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

#pia-edit-modal .pia-span-full {
  grid-column: 1 / -1;
}

#pia-edit-modal .pia-span-2 {
  grid-column: span 2;
}

#pia-edit-modal .pia-inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#pia-edit-modal .pia-inline-actions select {
  flex: 1;
  min-width: 0;
}

#pia-edit-modal .pia-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#pia-edit-modal .pia-quick-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgb(226 232 240 / 0.95);
  background: #fff;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#pia-edit-modal .pia-quick-chip.is-on {
  border-color: var(--ai-blue);
  background: #e8f3ff;
  color: var(--ai-blue);
}

#pia-edit-modal .pia-search-wrap {
  position: relative;
}

#pia-edit-modal .pia-search-wrap > input {
  width: 100%;
  box-sizing: border-box;
}

#pia-edit-modal .pia-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgb(226 232 240 / 0.95);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(15 43 92 / 0.08);
}

#pia-edit-modal .pia-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgb(238 242 247 / 0.95);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

#pia-edit-modal .pia-dropdown-item:hover {
  background: #f8fbff;
}

#pia-edit-modal .pia-dropdown-title {
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 800;
}

#pia-edit-modal .pia-dropdown-meta {
  color: var(--ai-muted);
  font-size: 11px;
  margin-top: 2px;
}

#pia-edit-modal .pia-field-hint {
  margin: 0;
  color: var(--ai-muted);
  font-size: 11px;
  line-height: 1.4;
}

#pia-edit-modal .pia-process-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

#pia-edit-modal .pia-process-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgb(226 232 240 / 0.95);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

#pia-edit-modal .pia-process-option.is-on {
  border-color: var(--ai-blue);
  background: #f8fbff;
}

#pia-edit-modal .pia-process-option-title {
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 800;
}

#pia-edit-modal .pia-process-option-meta {
  color: var(--ai-muted);
  font-size: 11px;
  margin-top: 2px;
}

#pia-edit-modal .pia-process-option-check {
  color: var(--ai-blue);
  font-size: 14px;
  font-weight: 900;
}

#pia-edit-modal .pia-priority-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#pia-edit-modal .pia-priority-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgb(226 232 240 / 0.95);
  background: #fff;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#pia-edit-modal .pia-priority-chip.is-on {
  border-color: var(--ai-blue);
  background: #e8f3ff;
  color: var(--ai-blue);
}

#pia-edit-modal #pia-priority-custom {
  margin-top: 8px;
}

.pia-product-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
}

.pia-browse-search {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  margin-bottom: 10px;
}

.pia-browse-list {
  flex: 1;
  min-height: 180px;
  max-height: 52vh;
  overflow: auto;
  border: 1px solid rgb(226 232 240 / 0.95);
  border-radius: 12px;
  background: #fff;
}

.pia-browse-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgb(238 242 247 / 0.95);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.pia-browse-item:hover {
  background: #f8fbff;
}

@media (max-width: 1180px) {
  #pia-edit-modal .pia-span-2 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #pia-edit-modal .pia-inline-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

#pia-edit-modal .pia-field-label {
  display: flex;
  align-items: flex-end;
  min-height: 2.6em;
  line-height: 1.35;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 900;
}

#pia-edit-modal .itr-form label > select,
#pia-edit-modal .itr-form label > input,
#pia-edit-modal .pia-notes > input,
#pia-edit-modal .pia-search-wrap > input,
#pia-edit-modal #pia-priority-custom {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

#pia-edit-modal .pia-notes {
  width: 100%;
}

#pia-edit-modal .pia-form-actions {
  justify-content: flex-end;
  align-self: stretch;
  margin-top: 4px;
  padding-top: 12px;
  padding-bottom: 2px;
  border-top: 1px solid rgb(229 237 247 / 0.92);
}

#pia-edit-modal .itr-form label {
  color: var(--ai-muted);
  font-weight: 900;
}

#pia-edit-modal .itr-form input,
#pia-edit-modal .itr-form select,
#page-process-inspectors .itr-filter input {
  min-height: 42px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#pia-edit-modal .itr-form input:focus,
#pia-edit-modal .itr-form select:focus,
#page-process-inspectors .itr-filter input:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

#page-process-inspectors .itr-filter {
  position: relative;
  padding: 20px 16px 16px;
}

#page-process-inspectors .pia-lane-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1677ff;
  font-size: 11px;
  font-weight: 850;
}

#page-process-inspectors .pia-empty-cell {
  padding: 36px 16px !important;
  text-align: center;
  background: #fbfdff !important;
}

#page-process-inspectors .pia-empty-cell .empty-state {
  margin: 0 auto;
  max-width: 420px;
}

@media (max-width: 1180px) {
  #pia-edit-modal .pia-form-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #pia-edit-modal .pia-form-primary {
    grid-template-columns: 1fr;
  }
}

#page-inspection-rules .itr-filter {
  position: relative;
  padding: 20px 16px 16px;
}

.itr-query-badge {
  position: absolute;
  left: 18px;
  top: -10px;
  z-index: 1;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.itr-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ai-line);
  background:
    linear-gradient(90deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 12rem);
}

.itr-table-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.itr-table-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12);
}

.itr-table-head h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.itr-table-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
}

.itr-table-insight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 460px;
  padding: 7px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.itr-table-insight i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

#page-inspection-rules .itr-table-wrap .data-table thead th {
  padding: 13px 12px;
  background: linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #52627a !important;
  font-size: 11px;
  font-weight: 950 !important;
  letter-spacing: .04em;
}

#page-inspection-rules .itr-table-wrap .data-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-inspection-rules .itr-table-wrap .data-table tbody tr:hover td {
  background:
    linear-gradient(90deg, rgb(234 244 255 / 0.76), rgb(255 255 255 / 0.94)) !important;
}

.itr-rule-cell strong {
  display: block;
  color: var(--ai-text);
  font-weight: 950;
}

.itr-rule-cell small {
  display: block;
  margin-top: 4px;
  color: var(--ai-muted);
  line-height: 1.45;
}

.itr-token,
.itr-priority-badge,
.itr-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-width: 220px;
  padding: 4px 10px;
  border-radius: 999px !important;
  font-size: 11px;
  font-weight: 950 !important;
  line-height: 1;
  white-space: nowrap;
}

.itr-token {
  /* inline-flex + center 会让超长文本两侧同时被裁掉开头；inline-block 才能让 ellipsis 生效 */
  display: inline-block;
  overflow: hidden;
  border: 1px solid rgb(47 125 255 / 0.12);
  background: #f6f9ff;
  color: var(--ai-sub);
  text-align: center;
  text-overflow: ellipsis;
  line-height: 18px;
}

.itr-token-lane,
.itr-priority-badge {
  background: #eef6ff;
  color: var(--ai-blue);
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

.itr-template-token {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  max-width: 210px;
  padding: 7px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  text-align: left;
}

button.itr-template-token {
  margin: 0;
  appearance: none;
  cursor: pointer;
  font: inherit;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

button.itr-template-token:hover,
button.itr-template-token:focus-visible {
  border-color: rgb(47 125 255 / 0.34);
  box-shadow: 0 0 0 3px rgb(47 125 255 / 0.12);
  transform: translateY(-1px);
}

.itr-template-token code {
  color: var(--ai-blue);
  font-family: var(--mono);
  font-weight: 950;
}

.itr-template-token small {
  overflow: hidden;
  color: var(--ai-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itr-row-actions {
  white-space: nowrap;
}

.itr-row-actions .btn,
.itr-row-actions .btn-delete {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px !important;
  font-size: 12px;
  font-weight: 950 !important;
}

.itr-action-edit,
.itr-action-toggle {
  border-color: rgb(47 125 255 / 0.14) !important;
  background: #eef6ff !important;
  color: var(--ai-blue) !important;
}

.itr-action-danger {
  border: 1px solid rgb(239 68 68 / 0.14);
  background: #fff1f2;
  color: #dc2626;
}

.itr-empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 190px;
  padding: 28px;
  border: 1px dashed rgb(47 125 255 / 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgb(47 125 255 / 0.09), transparent 14rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ai-sub);
  text-align: center;
}

.itr-empty-state strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

.itr-empty-state p {
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
}

.itr-empty-orb {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  box-shadow: 0 0 0 10px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.24);
}

/* 规则类页面同步：抽样、状态判定、自动发布规则 */
#page-mdm-sampling .sampling-filter-panel,
#page-mdm-sampling .sampling-create-panel,
#page-mdm-sampling .sampling-table-wrap,
#page-mdm-status .mdm-status-filter,
#page-mdm-status .mdm-status-section,
#page-mdm-status .mdm-status-add-panel,
#page-auto-rules .form-row,
#page-auto-rules .form-grid,
#page-auto-rules .table-wrap,
#page-auto-rules .card {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-mdm-sampling input,
#page-mdm-sampling select,
#page-mdm-status input,
#page-mdm-status select,
#page-mdm-status textarea,
#page-auto-rules input,
#page-auto-rules select,
#page-auto-rules textarea {
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-mdm-sampling input:focus,
#page-mdm-sampling select:focus,
#page-mdm-status input:focus,
#page-mdm-status select:focus,
#page-mdm-status textarea:focus,
#page-auto-rules input:focus,
#page-auto-rules select:focus,
#page-auto-rules textarea:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

/* 自动发布任务 · Auto Release Command Center */
#page-auto-rules {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-auto-rules .ar-command-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  align-items: stretch;
  box-sizing: border-box;
}

#page-auto-rules .ar-hero,
#page-auto-rules .ar-rule-console,
#page-auto-rules .ar-rule-form,
#page-auto-rules .ar-registry-panel {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-auto-rules .ar-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-auto-rules .ar-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-auto-rules .ar-hero > * {
  position: relative;
  z-index: 1;
}

#page-auto-rules .ar-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-auto-rules .ar-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-auto-rules .ar-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-auto-rules .ar-hero p:not(.ar-hero-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-auto-rules .ar-hero-tags,
#page-auto-rules .ar-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-auto-rules .ar-hero-tags {
  margin-top: 14px;
}

#page-auto-rules .ar-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-auto-rules .ar-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

#page-auto-rules .ar-kpi {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-auto-rules .ar-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--ar-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-auto-rules .ar-kpi-green { --ar-kpi-color: #22c55e; }
#page-auto-rules .ar-kpi-gray { --ar-kpi-color: #64748b; }
#page-auto-rules .ar-kpi-red { --ar-kpi-color: #ef4444; }

#page-auto-rules .ar-kpi span,
#page-auto-rules .ar-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-auto-rules .ar-kpi strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-auto-rules .ar-rule-console {
  align-items: center;
  padding: 18px !important;
}

#page-auto-rules .ar-rule-console::before {
  content: none !important;
  display: none !important;
}

#page-auto-rules .ar-console-head {
  flex: 1 1 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-auto-rules .ar-console-head strong,
#page-auto-rules .ar-registry-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-auto-rules .ar-console-head p,
#page-auto-rules .ar-registry-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-auto-rules .ar-rule-form {
  padding: 18px !important;
}

#page-auto-rules .ar-rule-form input,
#page-auto-rules .ar-rule-form select {
  height: 38px;
}

#page-auto-rules .ar-registry-panel {
  overflow: hidden;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

#page-auto-rules .ar-registry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf3fb;
}

#page-auto-rules .ar-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#page-auto-rules .ar-table thead th {
  background: #f6faff;
  color: #5b6b84;
  font-size: 12px;
  font-weight: 900;
}

#page-auto-rules .ar-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-auto-rules .ar-table tbody tr:hover td {
  background: #f8fbff;
}

#page-auto-rules .ar-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

#page-auto-rules .ar-status-active {
  background: #e8fff2;
  color: #16a34a;
}

#page-auto-rules .ar-status-stopped {
  background: #f1f5f9;
  color: #64748b;
}

#page-auto-rules .ar-rule-name {
  color: var(--ai-text);
  font-weight: 950;
}

#page-auto-rules .ar-empty-cell {
  padding: 34px 16px !important;
  text-align: center;
}

#page-auto-rules .ar-empty-cell strong,
#page-auto-rules .ar-empty-cell span {
  display: block;
}

#page-auto-rules .ar-empty-cell strong {
  margin-bottom: 4px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-auto-rules .ar-hero,
  #page-auto-rules .ar-registry-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #page-auto-rules .ar-kpi-grid {
    grid-template-columns: 1fr;
  }
}

#page-mdm-status .mdm-status-kpis {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#page-mdm-status .mdm-status-kpi.kpi-filter-btn.is-active small::after {
  content: none !important;
}

#page-mdm-status .mdm-status-kpi.kpi-filter-btn small {
  display: block !important;
  width: auto !important;
  max-width: 100%;
  line-height: 1.4;
  white-space: normal;
  word-break: keep-all;
}

#page-mdm-status .mdm-status-kpi.kpi-filter-btn.is-active small {
  display: block !important;
  width: auto !important;
  max-width: 100%;
  padding: 4px 8px !important;
}

/* Sampling Strategy Intelligence Hub 专属深化 */
#page-mdm-sampling .sampling-hero,
#page-mdm-sampling .sampling-filter-panel,
#page-mdm-sampling .sampling-create-panel,
#page-mdm-sampling .sampling-transfer-card,
#page-mdm-sampling .sampling-policy-details,
#page-mdm-sampling .sampling-table-wrap {
  border-color: var(--ai-line) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.1), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 16px 36px rgb(15 43 92 / 0.055) !important;
}

#page-mdm-sampling .sampling-hero {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f7fbff) !important;
}

#page-mdm-sampling .sampling-hero::after {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -38px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

.sampling-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sampling-section-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12);
}

#page-mdm-sampling .sampling-hero h2 {
  color: var(--ai-text);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-mdm-sampling .sampling-hero p {
  max-width: 620px;
  color: var(--ai-sub);
  line-height: 1.58;
}

.sampling-hero-actions {
  position: relative;
  z-index: 1;
  align-items: center;
}

.sampling-ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgb(47 125 255 / 0.14);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sampling-ai-chip i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

#page-mdm-sampling .sampling-filter-panel {
  position: relative;
  gap: 12px;
  padding: 20px 16px 16px;
}

.sampling-query-badge {
  position: absolute;
  left: 18px;
  top: -10px;
  z-index: 1;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-mdm-sampling .sampling-filter-panel label {
  color: var(--ai-muted);
  font-weight: 900;
}

#page-mdm-sampling .sampling-filter-panel input,
#page-mdm-sampling .sampling-filter-panel select,
#page-mdm-sampling .sampling-create-panel input,
#page-mdm-sampling .sampling-create-panel select,
#page-mdm-sampling .sampling-transfer-card input,
#page-mdm-sampling .sampling-policy-details input {
  min-height: 42px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-mdm-sampling .sampling-kpi:not(.is-active) {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 30px rgb(15 43 92 / 0.055) !important;
  overflow: hidden;
  min-height: 118px;
  padding: 20px 18px 16px 68px;
  text-align: left;
}

#page-mdm-sampling .sampling-kpi::before {
  border-radius: 16px;
  background:
    linear-gradient(135deg, var(--sampling-kpi-bg, #e8f3ff), #ffffff);
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

#page-mdm-sampling .sampling-kpi:not(.is-active) strong {
  color: var(--ai-text);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-mdm-sampling .sampling-kpi small {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(248 251 255 / 0.9);
  color: var(--ai-muted);
}

#page-mdm-sampling .sampling-create-panel {
  grid-template-columns: minmax(210px, 1.2fr) repeat(4, minmax(120px, 1fr)) minmax(110px, .8fr) minmax(180px, 1.2fr) auto auto;
  align-items: center;
  padding: 16px;
}

.sampling-create-copy {
  min-width: 0;
}

.sampling-create-copy strong {
  display: block;
  color: var(--ai-text);
  font-weight: 950;
}

.sampling-create-copy small {
  display: block;
  margin-top: 4px;
  color: var(--ai-sub);
  line-height: 1.5;
}

#page-mdm-sampling .sampling-policy-details {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

#page-mdm-sampling .sampling-policy-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

#page-mdm-sampling .sampling-policy-summary::-webkit-details-marker {
  display: none;
}

#page-mdm-sampling .sampling-policy-summary::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  margin-right: 2px;
  transform: rotate(-45deg);
  transition: transform .16s var(--ease-out);
}

#page-mdm-sampling .sampling-policy-details[open] .sampling-policy-summary::before {
  transform: rotate(45deg);
}

#page-mdm-sampling .sampling-policy-summary-main {
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 800;
}

#page-mdm-sampling .sampling-policy-summary-meta {
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 600;
}

#page-mdm-sampling .sampling-policy-body {
  padding: 0 16px 14px 28px;
  border-top: 1px solid rgb(226 235 247 / 0.9);
}

#page-mdm-sampling .sampling-policy-note {
  margin: 10px 0 12px;
  color: var(--ai-sub);
  font-size: 12px;
  line-height: 1.55;
}

#page-mdm-sampling .sampling-policy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 12px 14px;
  align-items: end;
  margin-bottom: 0;
}

#page-mdm-sampling .sampling-policy-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 58px;
}

#page-mdm-sampling .sampling-table-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.sampling-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ai-line);
  background:
    linear-gradient(90deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 12rem);
}

.sampling-table-head h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.sampling-table-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
}

.sampling-table-insight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 500px;
  padding: 7px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sampling-table-insight i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

#page-mdm-sampling .sampling-table thead th {
  padding: 13px 12px;
  background: linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #52627a !important;
  font-size: 11px;
  font-weight: 950 !important;
  letter-spacing: .04em;
}

#page-mdm-sampling .sampling-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-mdm-sampling .sampling-table tbody tr:hover td {
  background:
    linear-gradient(90deg, rgb(234 244 255 / 0.76), rgb(255 255 255 / 0.94)) !important;
}

.sampling-code-token,
.sampling-aql-badge,
.sampling-level-badge,
.sampling-standard-token,
.sampling-status-badge,
.sampling-creator-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-width: 220px;
  padding: 4px 10px;
  border-radius: 999px !important;
  font-size: 11px;
  font-weight: 950 !important;
  line-height: 1;
  white-space: nowrap;
}

.sampling-code-token,
.sampling-aql-badge {
  background: #eef6ff;
  color: var(--ai-blue) !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

.sampling-level-badge,
.sampling-standard-token,
.sampling-creator-token {
  overflow: hidden;
  border: 1px solid rgb(47 125 255 / 0.12);
  background: #f6f9ff;
  color: var(--ai-sub);
  text-overflow: ellipsis;
}

.sampling-name-cell strong {
  display: block;
  color: var(--ai-text);
  font-weight: 950;
}

.sampling-name-cell small {
  display: block;
  margin-top: 4px;
  color: var(--ai-muted);
  line-height: 1.45;
}

.sampling-row-actions {
  white-space: nowrap;
}

.sampling-row-actions .btn,
.sampling-row-actions .btn-delete {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px !important;
  font-size: 12px;
  font-weight: 950 !important;
}

.sampling-action-edit {
  border-color: rgb(47 125 255 / 0.14) !important;
  background: #eef6ff !important;
  color: var(--ai-blue) !important;
}

.sampling-action-danger {
  border: 1px solid rgb(239 68 68 / 0.14);
  background: #fff1f2;
  color: #dc2626;
}

.sampling-empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 190px;
  padding: 28px;
  border: 1px dashed rgb(47 125 255 / 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgb(47 125 255 / 0.09), transparent 14rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ai-sub);
  text-align: center;
}

.sampling-empty-state strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

.sampling-empty-state p {
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
}

.sampling-empty-orb {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  box-shadow: 0 0 0 10px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.24);
}

/* AI Review Command Center 专属深化 */
#page-ai-review .ai-review-hero,
#page-ai-review .ai-review-filter,
#page-ai-review .ai-review-toolbar,
#page-ai-review .ai-batch-table-wrap,
#page-ai-review .ai-draft-table-wrap,
#page-ai-review .ai-flat-table-wrap,
#page-ai-review .ai-draft-detail-card {
  border-color: var(--ai-line) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.1), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 16px 36px rgb(15 43 92 / 0.055) !important;
}

.ai-review-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid var(--ai-line);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.84);
  box-shadow: 0 10px 26px rgb(15 43 92 / 0.045);
}

.ai-review-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ai-review-tab span {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #eef4fd;
  color: var(--ai-muted);
  font-size: 10px;
  text-align: center;
}

.ai-review-tab.is-active {
  border-color: rgb(47 125 255 / 0.22);
  background: linear-gradient(135deg, var(--ai-blue), #1688ff);
  color: #fff;
  box-shadow: 0 8px 18px rgb(47 125 255 / 0.2);
}

.ai-review-tab.is-active span {
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}

#page-ai-review .ai-review-hero {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f7fbff) !important;
}

#page-ai-review .ai-review-hero::after {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -38px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

.ai-review-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ai-review-section-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12);
}

#page-ai-review .ai-review-hero h2 {
  color: var(--ai-text);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-ai-review .ai-review-hero p {
  max-width: 620px;
  color: var(--ai-sub);
  line-height: 1.58;
}

.ai-review-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-review-ready-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgb(47 125 255 / 0.14);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-review-ready-chip i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

#page-ai-review .ai-review-filter,
#page-ai-review .ai-review-toolbar {
  position: relative;
  padding: 20px 16px 16px;
}

.ai-review-query-badge,
.ai-review-toolbar-badge {
  position: absolute;
  left: 18px;
  top: -10px;
  z-index: 1;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-ai-review .ai-review-date-filter,
#page-ai-review .ai-review-search {
  padding: 6px;
  border: 1px solid rgb(47 125 255 / 0.08);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.72);
}

#page-ai-review .ai-review-filter input,
#page-ai-review .ai-review-filter select,
#page-ai-review .ai-review-toolbar input,
#page-ai-review .ai-review-toolbar select,
#page-ai-review .ai-draft-detail-card input,
#page-ai-review .ai-draft-detail-card select {
  min-height: 42px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-ai-review .ai-review-filter input:focus,
#page-ai-review .ai-review-filter select:focus,
#page-ai-review .ai-review-toolbar input:focus,
#page-ai-review .ai-review-toolbar select:focus,
#page-ai-review .ai-draft-detail-card input:focus,
#page-ai-review .ai-draft-detail-card select:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

#page-ai-review .ai-review-kpi:not(.is-active) {
  overflow: hidden;
  min-height: 118px;
  padding: 20px 18px 16px 68px;
  border-radius: 24px !important;
}

#page-ai-review .ai-review-kpi::before {
  border-radius: 16px;
  background:
    linear-gradient(135deg, var(--ai-kpi-bg, #e8f3ff), #ffffff);
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

#page-ai-review .ai-review-kpi:not(.is-active) strong {
  color: var(--ai-text);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-ai-review .ai-review-kpi small {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(248 251 255 / 0.9);
  color: var(--ai-muted);
}

.ai-review-table-head,
.ai-draft-decision-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ai-line);
  background:
    linear-gradient(90deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 12rem);
}

.ai-draft-decision-head {
  margin: -16px -16px 16px;
  border-radius: 26px 26px 0 0;
}

.ai-draft-source-file {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--ai-line);
  border-radius: 14px;
  background: #f8fbff;
}

.ai-draft-source-file span {
  flex: 0 0 auto;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 800;
}

.ai-draft-source-file strong {
  overflow-wrap: anywhere;
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 950;
}

.ai-draft-source-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}

.ai-draft-source-summary .ai-draft-source-file {
  min-width: 0;
  margin: 0;
}

.ai-draft-source-summary .ai-draft-source-file strong {
  flex: 1 1 auto;
}

.ai-draft-status-rail {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--ai-line);
  border-radius: 14px;
  background: #fff;
}

.ai-draft-status-rail > span {
  display: grid;
  gap: 3px;
  min-width: 92px;
  padding: 4px 10px;
  color: var(--ai-muted);
  font-size: 10px;
}

.ai-draft-status-rail strong {
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 950;
}

.ai-draft-status-rail strong[data-status='pending_review'],
.ai-draft-status-rail strong[data-status='queued'],
.ai-draft-status-rail strong[data-status='parsing'] {
  color: #b45309;
}

.ai-draft-status-rail strong[data-status='approved'],
.ai-draft-status-rail strong[data-status='published'] {
  color: #15803d;
}

.ai-draft-status-rail strong[data-status='rejected'],
.ai-draft-status-rail strong[data-status='parse_failed'] {
  color: #dc2626;
}

.ai-draft-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  align-items: start;
  gap: 16px;
}

.ai-draft-decision-sidebar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 68px;
}

.ai-review-step {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ai-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.ai-review-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ai-review-step-head > span {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ai-blue), #22a8f5);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 7px 16px rgb(47 125 255 / 0.18);
}

.ai-review-step-head > div {
  display: grid;
  gap: 2px;
}

.ai-review-step-head strong {
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 950;
}

.ai-review-step-head small {
  color: var(--ai-muted);
  font-size: 11px;
}

.ai-review-field-group-title {
  margin: 16px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgb(226 235 247 / 0.9);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
}

.ai-review-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-review-field-grid label,
.ai-draft-decision-sidebar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ai-sub);
  font-size: 11px;
  font-weight: 850;
}

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

.ai-draft-decision-sidebar .ai-publish-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.ai-draft-decision-sidebar .ai-publish-options > * {
  grid-column: auto;
}

.ai-draft-decision-sidebar .ai-conflict-hint,
.ai-draft-decision-sidebar .ai-product-match {
  margin-top: 10px;
}

.ai-publish-header-summary {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #f8fafc;
}

.ai-publish-header-summary > div {
  display: grid;
  gap: 2px;
}

.ai-publish-header-summary dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ai-publish-header-summary dd {
  margin: 0;
  color: #172033;
  font-size: 13px;
  font-weight: 750;
  word-break: break-all;
}

.ai-publish-header-summary dd.is-empty {
  color: #dc2626;
}

.ai-draft-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ai-draft-action-buttons .btn {
  width: 100%;
  min-height: 38px;
  border-radius: 12px !important;
  font-weight: 900;
}

.ai-draft-action-buttons #ai-d-action-publish {
  grid-column: 1 / -1;
}

.ai-draft-items-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--ai-line);
}

.ai-items-section-head {
  margin-bottom: 10px;
}

@media (max-width: 1180px) {
  .ai-draft-review-layout {
    grid-template-columns: 1fr;
  }

  .ai-draft-decision-sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .ai-draft-source-summary,
  .ai-review-field-grid,
  .ai-draft-decision-sidebar {
    grid-template-columns: 1fr;
  }

  .ai-draft-status-rail {
    overflow-x: auto;
  }

  .ai-review-field-wide {
    grid-column: auto;
  }
}

.ai-review-table-head h3,
.ai-draft-decision-head h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.ai-review-table-head p,
.ai-draft-decision-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
}

.ai-review-table-insight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 500px;
  padding: 7px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: linear-gradient(90deg, #eef6ff, #ffffff);
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-review-table-insight i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.12), 0 0 18px rgb(47 125 255 / 0.32);
}

.ai-review-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.ai-review-table-actions .btn {
  min-height: 34px;
  border-radius: 999px !important;
  font-weight: 950;
}

#page-ai-review .ai-batch-table thead th,
#page-ai-review .ai-draft-table thead th,
#page-ai-review .ai-flat-table thead th,
#page-ai-review .ai-draft-detail-card .data-table thead th {
  padding: 13px 12px;
  background: linear-gradient(180deg, #f4f8ff, #eef6ff) !important;
  color: #52627a !important;
  font-size: 11px;
  font-weight: 950 !important;
  letter-spacing: .04em;
}

#page-ai-review .ai-batch-table tbody td,
#page-ai-review .ai-draft-table tbody td,
#page-ai-review .ai-flat-table tbody td,
#page-ai-review .ai-draft-detail-card .data-table tbody td {
  padding: 13px 12px;
  border-bottom-color: rgb(226 235 247 / 0.78);
  vertical-align: middle;
}

#page-ai-review .ai-batch-table tbody tr:hover td,
#page-ai-review .ai-draft-table tbody tr:hover td,
#page-ai-review .ai-flat-table tbody tr:hover td,
#page-ai-review .ai-draft-detail-card .data-table tbody tr:hover td,
#page-ai-review .ai-batch-table .row-selected td,
#page-ai-review .ai-draft-table .row-selected td,
#page-ai-review .ai-flat-table .row-selected td {
  background:
    linear-gradient(90deg, rgb(234 244 255 / 0.76), rgb(255 255 255 / 0.94)) !important;
}

.ai-flat-table tbody tr {
  cursor: pointer;
}

.ai-flat-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 800;
}

.ai-flat-pagination > div {
  display: flex;
  gap: 8px;
}

.ai-review-batch-token,
.ai-review-template-token,
.ai-review-count-badge,
.ai-review-soft-token,
.ai-review-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-width: 220px;
  padding: 4px 10px;
  border-radius: 999px !important;
  font-size: 11px;
  font-weight: 950 !important;
  line-height: 1;
  white-space: nowrap;
}

.ai-review-batch-token,
.ai-review-template-token,
.ai-review-count-badge {
  background: #eef6ff;
  color: var(--ai-blue) !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1);
}

.ai-review-count-warn {
  background: #fff7e6;
  color: #b45309 !important;
  box-shadow: inset 0 0 0 1px rgb(245 158 11 / 0.16);
}

.ai-review-soft-token {
  overflow: hidden;
  border: 1px solid rgb(47 125 255 / 0.12);
  background: #f6f9ff;
  color: var(--ai-sub);
  text-overflow: ellipsis;
}

.ai-review-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-width: 220px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px !important;
  font-size: 11px;
  font-weight: 950 !important;
  line-height: 1;
  white-space: nowrap;
}

.ai-review-status-badge.ai-review-status-approved {
  background: #ecfdf3;
  color: #15803d !important;
  border-color: rgb(34 197 94 / 0.35);
}

.ai-review-status-badge.ai-review-status-pending {
  background: #fff7e6;
  color: #b45309 !important;
  border-color: rgb(245 158 11 / 0.35);
}

.ai-review-status-badge.ai-review-status-rejected,
.ai-review-status-badge.ai-review-status-failed {
  background: #fff1f2;
  color: #dc2626 !important;
  border-color: rgb(239 68 68 / 0.35);
}

.ai-review-status-badge.ai-review-status-pipeline {
  background: #eff6ff;
  color: #2563eb !important;
  border-color: rgb(59 130 246 / 0.3);
}

.ai-review-status-badge.ai-review-status-muted {
  background: #f1f5f9;
  color: #64748b !important;
  border-color: #e2e8f0;
}

.ai-review-file-cell strong {
  display: block;
  color: var(--ai-text);
  font-weight: 950;
}

.ai-review-row-actions {
  white-space: nowrap;
}

.ai-review-row-actions .btn,
.ai-review-row-actions .btn-delete {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px !important;
  font-size: 12px;
  font-weight: 950 !important;
}

.ai-review-action-primary,
.ai-review-action-secondary {
  border-color: rgb(47 125 255 / 0.14) !important;
  background: #eef6ff !important;
  color: var(--ai-blue) !important;
}

.ai-review-empty-inline,
.ai-review-empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 190px;
  padding: 28px;
  border: 1px dashed rgb(47 125 255 / 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgb(47 125 255 / 0.09), transparent 14rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ai-sub);
  text-align: center;
}

.ai-review-empty-state--compact {
  min-height: 150px;
}

.ai-review-empty-state strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

.ai-review-empty-state p {
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
}

.ai-review-empty-orb {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  box-shadow: 0 0 0 10px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.24);
}

@media (max-width: 760px) {
  .ai-review-table-head,
  .ai-draft-decision-head,
  .ai-review-hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-review-table-insight {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 1280px) {
  #page-mdm-sampling .sampling-create-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  #page-mdm-sampling .sampling-create-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #page-mdm-sampling .sampling-create-panel {
    grid-template-columns: 1fr;
  }

  .sampling-table-head,
  .sampling-table-head-tools,
  #page-mdm-sampling .sampling-policy-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  #page-mdm-sampling .sampling-policy-fields {
    grid-template-columns: 1fr;
  }

  #page-mdm-sampling .sampling-policy-actions {
    min-height: 0;
  }

  .sampling-table-insight {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 1280px) {
  #page-products .prod-action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .prod-hero::before,
  .entry-hero::before,
  .ct-hero::before,
  .tq-hero::before,
  .order-flow-hero::before,
  .mdmp-hero::before,
  .pcc-hero::before,
  .itr-hero::before {
    display: none;
  }

  .mdmp-hero {
    padding-right: 18px !important;
  }
}

/* 检验单台账 · Ledger Command Center */
#page-templates {
  background:
    radial-gradient(circle at 8% 0%, rgb(47 125 255 / 0.08), transparent 28rem),
    radial-gradient(circle at 92% 4%, rgb(34 211 238 / 0.10), transparent 24rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-templates .fc-page-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
}

#page-templates .fc-ledger-hero {
  position: relative;
  overflow: hidden;
  display: block;
  margin-bottom: 0;
  padding: 24px;
  border: 1px solid var(--ai-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.14), transparent 18rem),
    linear-gradient(135deg, #fff, #f8fbff);
  box-shadow: 0 18px 42px rgb(15 43 92 / 0.07);
}

#page-templates .fc-ledger-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -48px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-templates .fc-ledger-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-templates .fc-ledger-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-templates .fc-ledger-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

#page-templates .fc-ledger-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
}

#page-templates .fc-ledger-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn {
  position: relative;
  min-height: 118px;
  padding: 18px 18px 16px 68px !important;
  border-radius: var(--ai-radius-card, 22px) !important;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(47 125 255 / 0.12), transparent 7rem) !important;
  text-align: left;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--fc-ledger-kpi-bg, #eef6ff);
}

#page-templates .fc-ledger-kpi.kpi-filter-btn::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 30px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fc-ledger-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

#page-templates .fc-ledger-kpi.kpi-filter-btn > span,
#page-templates .fc-ledger-kpi.kpi-filter-btn > strong,
#page-templates .fc-ledger-kpi.kpi-filter-btn > small {
  display: block;
  position: relative;
  z-index: 1;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn > span {
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn > strong {
  margin: 8px 0 6px;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn > small {
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn.is-active::before {
  box-shadow: none !important;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn.is-active::after {
  left: 30px !important;
  top: 30px !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  background: var(--fc-ledger-kpi-color, var(--kpi-accent, #1677ff)) !important;
  box-shadow:
    0 0 0 4px rgb(255 255 255 / 0.88),
    0 0 16px color-mix(in srgb, var(--fc-ledger-kpi-color, var(--kpi-accent, #1677ff)) 58%, transparent) !important;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn.is-active > span {
  color: var(--kpi-accent, #1677ff);
  font-weight: 900;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn.is-active > small {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin-top: 0;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 800 !important;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent) !important;
}

#page-templates .fc-ledger-kpi.kpi-filter-btn.is-active > small::after {
  content: ' · 已筛选';
  color: var(--kpi-accent, #1677ff);
  font-weight: 700;
}

#page-templates .fc-ledger-kpi-blue { --fc-ledger-kpi-color: #1677ff; --fc-ledger-kpi-bg: #e8f3ff; }
#page-templates .fc-ledger-kpi-cyan { --fc-ledger-kpi-color: #0ea5e9; --fc-ledger-kpi-bg: #e6f7ff; }
#page-templates .fc-ledger-kpi-green { --fc-ledger-kpi-color: #16a34a; --fc-ledger-kpi-bg: #ecfdf3; }
#page-templates .fc-ledger-kpi-orange { --fc-ledger-kpi-color: #f59e0b; --fc-ledger-kpi-bg: #fff7e6; }

#page-templates .fc-tabs.mdm-tab-bar {
  margin-bottom: 14px;
  border-color: var(--ai-line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.9);
  box-shadow: 0 10px 24px rgb(15 43 92 / 0.05);
}

#page-templates .fc-layout {
  gap: 18px;
  align-items: stretch;
}

#page-templates .fc-tree,
#page-templates .fc-tag-section,
#page-templates .table-wrap {
  border: 1px solid var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.07), transparent 11rem),
    linear-gradient(180deg, #fff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-templates .fc-tree {
  width: 292px;
  padding: 16px;
}

#page-templates .fc-tree-title {
  margin-bottom: 12px;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

#page-templates .fc-tree-node {
  margin: 4px 0;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #40566f;
  font-weight: 750;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

#page-templates .fc-tree-node:hover {
  background: #f3f9ff;
  border-color: rgb(47 125 255 / 0.14);
  transform: translateX(2px);
}

#page-templates .fc-tree-node-active {
  border-color: rgb(47 125 255 / 0.24);
  background: #eaf4ff;
  color: var(--ai-blue);
  box-shadow: inset 3px 0 0 var(--ai-blue);
}

#page-templates .fc-toolbar {
  padding: 18px !important;
  margin-bottom: 14px;
}

#page-templates .fc-toolbar-row {
  gap: 12px 14px;
}

#page-templates .fc-field {
  color: var(--ai-sub);
  font-weight: 850;
}

#page-templates .fc-toolbar input,
#page-templates .fc-toolbar select {
  min-height: 38px;
  border: 1px solid #dbe7f5 !important;
  border-radius: 14px !important;
  background: rgb(255 255 255 / 0.92) !important;
  color: var(--ai-text);
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.03);
}

#page-templates .fc-tag-section {
  margin-bottom: 14px;
}

#page-templates .fc-tag-section-title {
  color: var(--ai-text);
  font-weight: 950;
}

#page-templates .fc-tag-pill {
  border-radius: 999px;
  font-weight: 850;
}

#page-templates .fc-tag-pill-active {
  box-shadow: 0 0 0 3px rgb(47 125 255 / 0.16);
}

#page-templates .fc-bulk-bar {
  border: 1px solid rgb(47 125 255 / 0.16);
  border-radius: 18px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-weight: 850;
}

#page-templates .fc-task-table {
  border-collapse: separate;
  border-spacing: 0;
}

#page-templates .fc-task-table thead th {
  background: linear-gradient(180deg, #f8fbff, #eef6ff) !important;
  color: #50627a;
  font-weight: 900;
  border-bottom: 1px solid var(--ai-line);
}

#page-templates .fc-task-table tbody td {
  border-bottom: 1px solid #eef3fa;
  vertical-align: top;
}

#page-templates .fc-task-table tbody tr:hover td {
  background: #f8fbff !important;
}

#page-templates .fc-empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 34px 16px;
  text-align: center;
  color: var(--ai-sub);
}

#page-templates .fc-empty-state strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

#page-templates .fc-empty-state p {
  max-width: 560px;
  margin: 0;
  line-height: 1.6;
}

#page-templates .fc-empty-orb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 0 12px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

#page-templates .fc-pagination {
  padding: 12px 2px 0;
}

@media (max-width: 1280px) {
  #page-templates .fc-ledger-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #page-templates .fc-layout {
    flex-direction: column;
  }

  #page-templates .fc-tree {
    width: 100%;
  }
}

@media (max-width: 900px) {
  #page-templates .fc-ledger-kpis {
    grid-template-columns: 1fr;
  }
}

/* 标签模板 · Tag Template Intelligence Hub */
#page-mdm-tags .tagtpl-hero {
  position: relative;
  overflow: hidden;
  padding: 24px !important;
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.14), transparent 18rem),
    linear-gradient(135deg, #fff, #f8fbff) !important;
  box-shadow: 0 18px 42px rgb(15 43 92 / 0.07) !important;
}

#page-mdm-tags .tagtpl-hero::after {
  content: '';
  position: absolute;
  right: 26px;
  bottom: -48px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-mdm-tags .tagtpl-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-mdm-tags .tagtpl-hero p {
  max-width: 720px;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-mdm-tags .tagtpl-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

#page-mdm-tags .tagtpl-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
}

#page-mdm-tags .tagtpl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

#page-mdm-tags .tagtpl-kpi:not(.is-active) {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--ai-line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
  text-align: left;
}

#page-mdm-tags .tagtpl-kpi-blue { --tagtpl-kpi-color: #1677ff; --tagtpl-kpi-bg: #e8f3ff; }
#page-mdm-tags .tagtpl-kpi-green { --tagtpl-kpi-color: #16a34a; --tagtpl-kpi-bg: #ecfdf3; }
#page-mdm-tags .tagtpl-kpi-purple { --tagtpl-kpi-color: #8b5cf6; --tagtpl-kpi-bg: #f5f3ff; }
#page-mdm-tags .tagtpl-kpi-cyan { --tagtpl-kpi-color: #0ea5e9; --tagtpl-kpi-bg: #e6f7ff; }

#page-mdm-tags .tagtpl-kpi::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--ai-blue);
  box-shadow: 0 0 0 7px rgb(47 125 255 / 0.08);
}

#page-mdm-tags .tagtpl-kpi-green::before { background: #22c55e; }
#page-mdm-tags .tagtpl-kpi-purple::before { background: #8b5cf6; }
#page-mdm-tags .tagtpl-kpi-cyan::before { background: #22d3ee; }

#page-mdm-tags .tagtpl-kpi span,
#page-mdm-tags .tagtpl-kpi small {
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-mdm-tags .tagtpl-kpi:not(.is-active) strong {
  display: block;
  margin: 2px 0 4px;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-mdm-tags .tagtpl-filter-panel,
#page-mdm-tags .tagtpl-editor-card,
#page-mdm-tags .tagtpl-list-card {
  border: 1px solid var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 11rem),
    linear-gradient(180deg, #fff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-mdm-tags .tagtpl-filter-panel {
  position: relative;
  padding: 18px !important;
}

#page-mdm-tags .tagtpl-filter-panel::before {
  content: 'AI Query Console';
  position: absolute;
  left: 18px;
  top: -10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-mdm-tags .tagtpl-filter-panel label,
#page-mdm-tags .tagtpl-card-head p,
#page-mdm-tags .tagtpl-tip {
  color: var(--ai-sub);
}

#page-mdm-tags .tagtpl-filter-panel input,
#page-mdm-tags .tagtpl-filter-panel select,
#page-mdm-tags .tagtpl-create-grid input,
#page-mdm-tags .tagtpl-create-grid select {
  min-height: 40px;
  border: 1px solid #dbe7f5 !important;
  border-radius: 14px !important;
  background: rgb(255 255 255 / 0.92) !important;
  color: var(--ai-text);
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.03);
}

#page-mdm-tags .tagtpl-card-head strong {
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

#page-mdm-tags .tagtpl-json-editor {
  min-height: 340px;
  border: 1px solid #dbe7f5 !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgb(248 251 255 / 0.96), #fff) !important;
  color: #213044;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8), 0 10px 24px rgb(15 43 92 / 0.04);
}

#page-mdm-tags .tagtpl-table-wrap {
  border: 1px solid var(--ai-line) !important;
  border-radius: 20px !important;
  background: #fff;
}

#page-mdm-tags .tagtpl-table thead th {
  background: linear-gradient(180deg, #f8fbff, #eef6ff) !important;
  color: #50627a;
  font-weight: 900;
}

#page-mdm-tags .tagtpl-table tbody td {
  border-bottom: 1px solid #eef3fa;
}

#page-mdm-tags .tagtpl-table tbody tr:hover td {
  background: #f8fbff !important;
}

#page-mdm-tags .tagtpl-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 34px 16px;
  text-align: center;
  color: var(--ai-sub);
}

#page-mdm-tags .tagtpl-empty-state strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

#page-mdm-tags .tagtpl-empty-state p {
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
}

#page-mdm-tags .tagtpl-empty-orb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 0 12px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

@media (max-width: 1180px) {
  #page-mdm-tags .tagtpl-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 760px) {
  #page-mdm-tags .tagtpl-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* 合作方 · Partner Intelligence Hub */
#page-mdm-partners {
  background:
    radial-gradient(circle at 10% 0%, rgb(47 125 255 / 0.08), transparent 28rem),
    radial-gradient(circle at 92% 4%, rgb(34 211 238 / 0.10), transparent 24rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-mdm-partners .mdp-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#page-mdm-partners .mdp-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--ai-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.14), transparent 18rem),
    linear-gradient(135deg, #fff, #f8fbff);
  box-shadow: 0 18px 42px rgb(15 43 92 / 0.07);
}

#page-mdm-partners .mdp-hero::after {
  content: '';
  position: absolute;
  right: 26px;
  bottom: -48px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-mdm-partners .mdp-hero > * {
  position: relative;
  z-index: 1;
}

#page-mdm-partners .mdp-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-mdm-partners .mdp-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-mdm-partners .mdp-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

#page-mdm-partners .mdp-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

#page-mdm-partners .mdp-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
}

#page-mdm-partners .mdp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 18px 18px 16px 68px !important;
  border: 2px solid transparent;
  border-radius: var(--ai-radius-card, 22px) !important;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(47 125 255 / 0.12), transparent 7rem) !important;
  text-align: left;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--mdp-kpi-bg, #eef6ff);
  box-shadow: none;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 30px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mdp-kpi-color, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn > span,
#page-mdm-partners .mdp-kpi.kpi-filter-btn > strong,
#page-mdm-partners .mdp-kpi.kpi-filter-btn > small {
  display: block;
  position: relative;
  z-index: 1;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn > span {
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn.is-active > span {
  color: var(--kpi-accent, #1677ff);
  font-weight: 900;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn > strong {
  margin: 8px 0 6px;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn > small {
  display: block;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn.is-active::before {
  box-shadow: none !important;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn.is-active::after {
  left: 30px !important;
  top: 30px !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  background: var(--mdp-kpi-color, var(--kpi-accent, #1677ff)) !important;
  box-shadow:
    0 0 0 4px rgb(255 255 255 / 0.88),
    0 0 16px color-mix(in srgb, var(--mdp-kpi-color, var(--kpi-accent, #1677ff)) 58%, transparent) !important;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn.is-active > small {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin-top: 0;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 800 !important;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent) !important;
}

#page-mdm-partners .mdp-kpi.kpi-filter-btn.is-active > small::after {
  content: ' · 已筛选';
  color: var(--kpi-accent, #1677ff);
  font-weight: 700;
}

#page-mdm-partners .mdp-kpi-blue { --mdp-kpi-color: #1677ff; --mdp-kpi-bg: #e8f3ff; }
#page-mdm-partners .mdp-kpi-green { --mdp-kpi-color: #22c55e; --mdp-kpi-bg: #ecfdf3; }
#page-mdm-partners .mdp-kpi-purple { --mdp-kpi-color: #8b5cf6; --mdp-kpi-bg: #f3e8ff; }
#page-mdm-partners .mdp-kpi-orange { --mdp-kpi-color: #f59e0b; --mdp-kpi-bg: #fff7e6; }
#page-mdm-partners .mdp-kpi-cyan { --mdp-kpi-color: #22d3ee; --mdp-kpi-bg: #e6f7ff; }

#page-mdm-partners .mdp-tab-bar {
  align-self: flex-start;
  border-color: var(--ai-line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  box-shadow: 0 10px 24px rgb(15 43 92 / 0.05);
}

#page-mdm-partners .mdp-help,
#page-mdm-partners .mdp-filter-panel,
#page-mdm-partners .mdp-table-wrap {
  border: 1px solid var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 11rem),
    linear-gradient(180deg, #fff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-mdm-partners .mdp-filter-panel {
  position: relative;
  padding: 32px 18px 18px !important;
}

#page-mdm-partners .mdp-filter-panel::before {
  content: 'Partner Registry Console';
  position: absolute;
  left: 18px;
  top: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-mdm-partners .mdp-filter-panel input,
#page-mdm-partners .mdp-filter-panel select {
  min-height: 40px;
  border: 1px solid #dbe7f5 !important;
  border-radius: 14px !important;
  background: rgb(255 255 255 / 0.92) !important;
  color: var(--ai-text);
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.03);
}

#page-mdm-partners .mdp-registry-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 10px;
  padding: 0 2px;
}

#page-mdm-partners .mdp-registry-head h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

#page-mdm-partners .mdp-registry-head p,
#page-mdm-partners .mdp-registry-head span {
  margin: 4px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-mdm-partners .mdp-table-wrap {
  overflow: hidden;
}

#page-mdm-partners .mdp-table-wrap .data-table {
  border-collapse: separate;
  border-spacing: 0;
}

#page-mdm-partners .mdp-table-wrap .data-table thead th {
  background: linear-gradient(180deg, #f8fbff, #eef6ff) !important;
  color: #50627a;
  font-weight: 900;
}

#page-mdm-partners .mdp-table-wrap .data-table tbody td {
  border-bottom: 1px solid #eef3fa;
}

#page-mdm-partners .mdp-table-wrap .data-table tbody tr:hover td {
  background: #f8fbff !important;
}

#page-mdm-partners .mdp-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 34px 16px;
  text-align: center;
  color: var(--ai-sub);
}

#page-mdm-partners .mdp-empty-state strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

#page-mdm-partners .mdp-empty-state p {
  max-width: 540px;
  margin: 0;
  line-height: 1.6;
}

#page-mdm-partners .mdp-empty-orb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 0 12px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

@media (max-width: 1280px) {
  #page-mdm-partners .mdp-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 760px) {
  #page-mdm-partners .mdp-hero {
    flex-direction: column;
  }

  #page-mdm-partners .mdp-kpi-grid {
    grid-template-columns: 1fr;
  }

  #page-mdm-partners .mdp-registry-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 检测录入 · Inspection Entry Command Center */
#page-entry .entry-page {
  gap: 16px;
}

#page-entry .entry-hero {
  align-items: flex-start !important;
  min-height: 126px;
  padding: 24px !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-entry .entry-hero::before {
  content: none !important;
  display: none !important;
}

#page-entry .entry-hero > * {
  position: relative;
  z-index: 1;
}

#page-entry .entry-hero h2 {
  margin-top: 4px !important;
  font-size: 26px !important;
}

#page-entry .entry-hero p {
  max-width: 720px;
  font-size: 13px;
}

#page-entry .entry-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-entry .entry-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-entry .entry-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-entry .entry-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-entry .entry-date-row {
  padding: 14px 16px !important;
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 98% 0%, rgb(34 211 238 / 0.10), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 12px 28px rgb(15 43 92 / 0.045) !important;
}

#page-entry .entry-date-title {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950 !important;
}

#page-entry .entry-date-search input {
  min-width: 420px;
  border-radius: 999px !important;
}

#page-entry .entry-search-panel {
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  padding: 20px !important;
}

#page-entry .entry-search-panel::before {
  content: none !important;
  display: none !important;
}

#page-entry .entry-search-panel-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf3fb;
}

#page-entry .entry-search-panel-title strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-entry .entry-search-panel-title span {
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-entry .entry-search-panel label {
  color: #51637a;
  font-weight: 850 !important;
}

#page-entry .entry-search-panel select {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgb(226 232 240 / 0.95);
  border-radius: 12px !important;
  background: rgb(255 255 255 / 0.92);
  color: var(--ai-text);
  outline: none;
}

#page-entry .entry-task-results {
  padding: 18px !important;
  border: 1px solid var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 8% 0%, rgb(22 119 255 / 0.08), transparent 18rem),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 18px 45px rgb(15 23 42 / 0.08) !important;
}

#page-entry .entry-task-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#page-entry .entry-task-results-head strong {
  color: var(--ai-blue);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#page-entry .entry-task-results-head p {
  margin: 4px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
}

#page-entry .entry-task-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

#page-entry .entry-task-result-card {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgb(226 232 240 / 0.9);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.86);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#page-entry .entry-task-result-card:hover {
  transform: translateY(-2px);
  border-color: rgb(22 119 255 / 0.35);
  box-shadow: 0 16px 35px rgb(22 119 255 / 0.12);
}

#page-entry .entry-task-result-card strong {
  color: var(--ai-text);
  font-size: 15px;
}

#page-entry .entry-task-result-card small,
#page-entry .entry-task-result-card em,
#page-entry .entry-task-results-empty span {
  color: var(--ai-sub);
  font-size: 12px;
  font-style: normal;
}

#page-entry .entry-task-result-kicker {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(22 119 255 / 0.08);
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 900;
}

#page-entry .entry-task-results-empty {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ai-text);
  text-align: center;
}

#page-entry .entry-finder-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#page-entry .entry-finder-option-group {
  padding: 12px;
  border: 1px solid rgb(226 232 240 / 0.82);
  border-radius: 18px;
  background: rgb(248 251 255 / 0.72);
}

#page-entry .entry-finder-option-group > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 900;
}

#page-entry .entry-finder-option-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-entry .entry-finder-option-group button {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgb(22 119 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.9);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

#page-entry .entry-finder-option-group button:hover {
  border-color: rgb(22 119 255 / 0.35);
  box-shadow: 0 8px 20px rgb(22 119 255 / 0.1);
}

#page-entry .entry-finder-option-group button small {
  max-width: 150px;
  overflow: hidden;
  color: var(--ai-sub);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-entry .entry-search-actions {
  align-items: flex-end;
}

#page-entry .entry-empty-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  border: 1px solid var(--ai-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 36%, rgb(47 125 255 / 0.08), transparent 11rem),
    linear-gradient(180deg, rgb(255 255 255 / 0.94), rgb(248 251 255 / 0.78));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.75);
}

#page-entry .entry-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ai-blue), var(--ai-electric));
  color: #fff;
  box-shadow: 0 0 0 12px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

#page-entry .entry-empty-modern .empty-text {
  margin-top: 14px;
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

#page-entry .entry-empty-modern .empty-hint {
  margin-top: 6px;
  color: var(--ai-sub);
  font-size: 12px;
}

#page-entry .entry-feature-card {
  min-height: 106px;
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-entry .entry-feature-card span {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #eaf4ff;
  color: var(--ai-blue);
}

#page-entry .entry-panel-modern {
  border-color: var(--ai-line) !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 16px 36px rgb(15 43 92 / 0.06) !important;
}

@media (max-width: 1280px) {
  #page-entry .entry-search-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  #page-entry .entry-finder-options {
    grid-template-columns: 1fr;
  }

  #page-entry .entry-date-search input {
    min-width: 280px;
  }
}

@media (max-width: 760px) {
  #page-entry .entry-date-search input {
    min-width: 0;
  }

  #page-entry .entry-search-panel-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 状态与判定：说明列输入框避免中文说明被压缩/遮挡 */
#page-mdm-status .mdm-status-table {
  table-layout: fixed;
  min-width: 1080px;
}

#page-mdm-status .mdm-status-table th:nth-child(1) { width: 16%; }
#page-mdm-status .mdm-status-table th:nth-child(2) { width: 18%; }
#page-mdm-status .mdm-status-table th:nth-child(3) { width: 34%; }
#page-mdm-status .mdm-status-table th:nth-child(4) { width: 9%; }
#page-mdm-status .mdm-status-table th:nth-child(5) { width: 8%; }
#page-mdm-status .mdm-status-table th:nth-child(6) { width: 15%; }

#page-mdm-status .mdm-status-table td {
  vertical-align: middle !important;
}

#page-mdm-status .mdm-status-desc-cell {
  min-width: 360px;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

#page-mdm-status textarea.mdm-inline-ta {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 72px !important;
  height: 72px;
  padding: 10px 12px !important;
  border: 1px solid rgb(47 125 255 / 0.14) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  color: var(--ai-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 20px !important;
  resize: vertical;
  overflow: auto;
  white-space: pre-wrap;
}

#page-mdm-status textarea.mdm-inline-ta:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1) !important;
}

#page-mdm-status .mdm-status-table input.mdm-inline-code,
#page-mdm-status .mdm-status-table input.mdm-inline-full,
#page-mdm-status .mdm-status-table input.narrow-num {
  box-sizing: border-box;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  border: 1px solid rgb(47 125 255 / 0.14) !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 750;
  line-height: 36px !important;
  vertical-align: middle;
}

#page-mdm-status .mdm-status-table input.mdm-inline-full {
  max-width: none;
}

#page-mdm-status .mdm-status-table input.narrow-num {
  width: 64px;
  padding: 0 8px !important;
  text-align: center;
}

#page-mdm-status .mdm-status-table input.mdm-inline-code {
  font-size: 12px;
}

#page-mdm-status .mdm-status-table input.mdm-inline-code:focus,
#page-mdm-status .mdm-status-table input.mdm-inline-full:focus,
#page-mdm-status .mdm-status-table input.narrow-num:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1) !important;
}

/* 创建任务单 · Task Creation Command Center */
#page-create-task .ct-page {
  gap: 16px;
}

#page-create-task .ct-hero {
  align-items: flex-start !important;
  padding: 24px !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-create-task .ct-hero::before {
  content: none !important;
  display: none !important;
}

#page-create-task .ct-hero > * {
  position: relative;
  z-index: 1;
}

#page-create-task .ct-hero-main {
  align-items: flex-start;
  gap: 14px;
}

#page-create-task .ct-hero-icon {
  margin-top: 4px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  box-shadow: 0 0 0 10px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

#page-create-task .ct-hero h2 {
  margin-top: 4px !important;
  font-size: 26px !important;
}

#page-create-task .ct-hero p:not(.ct-hero-badge) {
  max-width: 760px;
  line-height: 1.6;
}

#page-create-task .ct-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-create-task .ct-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-create-task .ct-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-create-task .ct-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-create-task .ct-hero-actions {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#page-create-task .ct-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

#page-create-task .ct-tip {
  border-color: var(--ai-line) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 9rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 12px 28px rgb(15 43 92 / 0.045) !important;
}

#page-create-task .ct-section,
#page-create-task .ct-side .card,
#page-create-task .ct-footer-actions {
  border-color: var(--ai-line) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-create-task .ct-section {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 22px;
}

#page-create-task .ct-section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ai-blue), #22d3ee);
  opacity: .7;
}

#page-create-task .ct-section-title {
  align-items: flex-start;
  margin-bottom: 18px;
}

#page-create-task .ct-section-title span {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.08);
}

#page-create-task .ct-section-title strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

#page-create-task .ct-section-title small {
  color: var(--ai-sub);
  font-weight: 750;
}

#page-create-task .ct-form-grid label,
#page-create-task .ct-override-reason {
  color: #51637a;
  font-weight: 850;
}

#page-create-task .ct-form-grid input,
#page-create-task .ct-form-grid select,
#page-create-task .ct-override-reason input {
  min-height: 42px;
  border: 1px solid rgb(47 125 255 / 0.12) !important;
  border-radius: 16px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.025);
}

#page-create-task .ct-form-grid input:focus,
#page-create-task .ct-form-grid select:focus,
#page-create-task .ct-override-reason input:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

#page-create-task .ct-gate-check {
  border-color: #aeb8c6 !important;
  border-radius: 18px !important;
  background: #f8fbff !important;
}

#page-create-task .ct-flow-path {
  border: 1px solid var(--ai-line);
  border-radius: 18px;
  background: #f8fbff;
}

#page-create-task .ct-flow-path span {
  border-radius: 12px;
  color: var(--ai-blue);
  font-weight: 850;
}

#page-create-task .ct-side {
  position: sticky;
  top: 84px;
  align-self: start;
}

#page-create-task .ct-side-title strong {
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 950;
}

#page-create-task .ct-side-title span {
  background: #eaf4ff;
  color: var(--ai-blue);
  font-weight: 900;
}

#page-create-task .ct-side-subtitle {
  margin: -4px 0 12px;
  color: var(--ai-sub);
  font-size: 12px;
  line-height: 1.55;
}

#page-create-task .ct-summary-tabs {
  border-color: var(--ai-line);
  border-radius: 16px;
}

#page-create-task .ct-summary-tabs span {
  background: #f8fbff;
  font-weight: 800;
}

#page-create-task .ct-summary-tabs .active {
  background: #eaf4ff;
  color: var(--ai-blue);
}

#page-create-task .ct-summary-score {
  border: 1px solid var(--ai-line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 8rem),
    linear-gradient(135deg, #f8fbff, #ffffff);
}

#page-create-task .ct-guide li {
  padding: 11px 12px 11px 34px;
  border: 1px solid var(--ai-line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.72);
}

#page-create-task .ct-guide li::before {
  left: 12px;
  top: 14px;
  width: 10px;
  height: 10px;
  border: 0;
  background: var(--ai-blue);
  box-shadow: 0 0 0 5px rgb(47 125 255 / 0.1);
}

#page-create-task .ct-quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#page-create-task .ct-quick-grid button {
  min-height: 50px;
  border-color: var(--ai-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ai-sub);
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.035);
}

#page-create-task .ct-footer-actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  align-items: center;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
}

#page-create-task .ct-footer-actions .btn-primary {
  min-width: 180px;
}

@media (max-width: 1280px) {
  #page-create-task .ct-layout {
    grid-template-columns: 1fr;
  }

  #page-create-task .ct-side {
    position: static;
  }
}

/* 任务单查询 · Task Query Command Center */
#page-task-query .tq-page {
  gap: 16px;
}

#page-task-query .tq-tabs,
#page-task-query .tq-hero,
#page-task-query .tq-filter-panel,
#page-task-query .tq-results-workspace {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-task-query .tq-hero {
  align-items: flex-start !important;
  padding: 24px !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-task-query .tq-hero::before {
  content: none !important;
  display: none !important;
}

body.layout-pro #page-task-query .tq-hero.card::before,
body.layout-pro #page-task-query .tq-hero::before,
#page-task-query .tq-hero.card::before {
  content: none !important;
  display: none !important;
}

#page-task-query .tq-hero > * {
  position: relative;
  z-index: 1;
}

#page-task-query .tq-hero-main {
  align-items: flex-start;
  gap: 14px;
}

#page-task-query .tq-hero-icon {
  margin-top: 4px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  box-shadow: 0 0 0 10px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

#page-task-query .tq-hero h2 {
  margin-top: 4px !important;
  font-size: 26px !important;
}

#page-task-query .tq-hero p:not(.tq-hero-badge) {
  max-width: 760px;
  line-height: 1.6;
}

#page-task-query .tq-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-task-query .tq-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-task-query .tq-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-task-query .tq-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-task-query .tq-search {
  flex-wrap: wrap;
  justify-content: flex-end;
}

#page-task-query .tq-search input {
  min-height: 42px;
  border: 1px solid rgb(47 125 255 / 0.12) !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.025);
}

#page-task-query .tq-kpi-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

#page-task-query .tq-kpi.kpi-filter-btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#page-task-query .tq-kpi:not(.is-active) {
  min-height: 108px;
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-task-query .tq-kpi::before {
  border-radius: 14px;
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-task-query .tq-kpi strong {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

/* 选中态边框已足够明显，不再追加「 · 已筛选」避免说明文字重叠 */
#page-task-query .tq-kpi.kpi-filter-btn.is-active small::after {
  content: none !important;
}

#page-task-query .tq-kpi.kpi-filter-btn small {
  display: block !important;
  width: auto !important;
  max-width: 100%;
  line-height: 1.4;
  white-space: normal;
  word-break: keep-all;
}

#page-task-query .tq-kpi.kpi-filter-btn.is-active small {
  padding: 4px 8px !important;
}

#page-task-query .tq-filter-panel {
  padding: 20px !important;
}

#page-task-query .tq-filter-panel::before {
  content: none !important;
  display: none !important;
}

#page-task-query .tq-filter-head {
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-task-query .tq-filter-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-task-query .tq-filter-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-task-query .tq-filter-grid label {
  color: #51637a;
  font-weight: 850;
}

#page-task-query .tq-filter-grid input,
#page-task-query .tq-filter-grid select,
#page-task-query .tq-bulk-inline select,
#page-task-query .tq-bulk-inline input[type="datetime-local"] {
  min-height: 40px;
  border: 1px solid rgb(47 125 255 / 0.12) !important;
  border-radius: 16px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-task-query .tq-results-workspace {
  padding: 0 !important;
}

#page-task-query .tq-results-head {
  padding: 18px 20px 0;
  border-bottom: 0;
}

#page-task-query .tq-results-kicker {
  color: var(--ai-blue);
  font-weight: 950;
}

#page-task-query .tq-results-intro p {
  color: var(--ai-sub);
}

#page-task-query .task-bulk-bar.tq-bulk-inline {
  margin: 12px 20px 0;
  padding: 10px 14px;
  border: 1px solid #e8eff8;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  box-shadow: none !important;
}

#page-task-query .tq-bulk-inline select,
#page-task-query .tq-bulk-inline input[type="datetime-local"] {
  min-height: 36px;
  border: 1px solid rgb(47 125 255 / 0.12) !important;
  border-radius: 12px !important;
  background: #fff !important;
}

#page-task-query .tq-bulk-inline .task-bulk-count {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.08);
  font-weight: 900;
}

#page-task-query .tq-results-workspace .task-cards.tq-task-grid {
  min-height: 240px;
  margin: 0;
  padding: 14px 20px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  gap: 16px;
}

body.layout-pro #page-task-query .task-cards.tq-task-grid .task-card,
#page-task-query .task-cards.tq-task-grid .task-card {
  overflow: hidden;
  min-height: 200px;
  padding: 16px 16px 15px;
  border: 1px solid var(--ai-line) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.06), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 10px 24px rgb(15 43 92 / 0.04) !important;
}

#page-task-query .task-cards.tq-task-grid .task-card-title {
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

#page-task-query .task-cards.tq-task-grid .task-card-meta {
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 7px 10px;
  color: #334155;
}

#page-task-query .task-cards.tq-task-grid .task-card-meta span {
  color: var(--ai-sub);
  font-weight: 800;
}

#page-task-query .task-cards.tq-task-grid .btn-icon {
  min-height: 28px;
  border-color: #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-weight: 700;
}

#page-task-query .task-cards.tq-task-grid .btn-icon:hover {
  border-color: rgb(239 68 68 / 0.35);
  background: #fff1f2;
  color: #dc2626;
}

#page-task-query .task-cards.tq-task-grid .task-card.task-card-danger {
  border-color: rgb(239 68 68 / 0.22) !important;
}

#page-task-query .task-cards.tq-task-grid .task-card.task-card-progress {
  border-color: rgb(14 165 233 / 0.22) !important;
}

#page-task-query .task-cards.tq-task-grid .task-card.task-card-waiting {
  border-color: rgb(245 158 11 / 0.22) !important;
}

#page-task-query .task-cards.tq-task-grid .task-card-info strong {
  font-size: 12px;
  line-height: 1.45;
}

#page-task-query .tq-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ai-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 30%, rgb(47 125 255 / 0.08), transparent 11rem),
    linear-gradient(180deg, rgb(255 255 255 / 0.94), rgb(248 251 255 / 0.78));
}

@media (max-width: 760px) {
  #page-task-query .tq-hero,
  #page-task-query .tq-hero-main,
  #page-task-query .tq-search,
  #page-task-query .tq-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 过程流总览 · Process Flow Command Center */
#page-flow-overview .fc-flow-overview-root {
  gap: 16px;
}

#page-flow-overview .fo-hero,
#page-flow-overview .fo-flow-panel,
#page-flow-overview .fo-card {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-flow-overview .fo-hero {
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-flow-overview .fo-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-flow-overview .fo-hero > * {
  position: relative;
  z-index: 1;
}

#page-flow-overview .fo-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-flow-overview .fo-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-flow-overview .fo-eyebrow {
  margin-bottom: 6px;
  color: var(--ai-blue);
  font-weight: 950;
}

#page-flow-overview .fo-hero h2 {
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-flow-overview .fo-hero p:not(.fo-hero-badge):not(.fo-eyebrow) {
  max-width: 760px;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-flow-overview .fo-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-flow-overview .fo-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-flow-overview .fo-kpi-grid {
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#page-flow-overview .fo-kpi:not(.is-active) {
  min-height: 108px;
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-flow-overview .fo-kpi::before {
  border-radius: 14px;
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-flow-overview .fo-kpi strong {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-flow-overview .fo-kpi span {
  color: var(--ai-text);
  font-weight: 900;
}

#page-flow-overview .fo-kpi.kpi-filter-btn.is-active small::after {
  content: none !important;
}

#page-flow-overview .fo-kpi.kpi-filter-btn small {
  display: block !important;
  width: auto !important;
  max-width: 100%;
  line-height: 1.4;
  white-space: normal;
  word-break: keep-all;
}

#page-flow-overview .fo-kpi.kpi-filter-btn.is-active small {
  padding: 4px 8px !important;
}

#page-flow-overview .fo-kpi-card:not(.is-active) {
  min-height: 108px;
  border: 1px solid var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-flow-overview .fo-kpi-icon {
  border-radius: 14px;
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-flow-overview .fo-kpi-card strong {
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-flow-overview .fo-kpi-card span {
  color: var(--ai-text);
  font-weight: 900;
}

#page-flow-overview .fo-flow-panel {
  overflow: hidden;
  padding: 20px !important;
}

#page-flow-overview .fo-section-head,
#page-flow-overview .fo-card-head {
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
  color: var(--ai-text);
  font-weight: 950;
}

#page-flow-overview .fo-section-head span,
#page-flow-overview .fo-card-head span {
  color: var(--ai-sub);
  font-weight: 750;
}

#page-flow-overview .fo-process-scroll {
  padding: 22px 12px 26px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgb(47 125 255 / 0.06), transparent 18rem),
    linear-gradient(180deg, rgb(255 255 255 / 0.70), rgb(248 251 255 / 0.78));
}

#page-flow-overview .fo-stage-box {
  min-height: 106px;
  border: 1px solid var(--ai-line) !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 12px 26px rgb(15 43 92 / 0.05);
}

#page-flow-overview .fo-stage-box strong {
  color: var(--ai-text);
  font-weight: 950;
}

#page-flow-overview .fo-stage-box[data-state='pass'],
#page-flow-overview .fo-check-diamond[data-state='pass'] {
  border-color: rgb(34 197 94 / 0.32) !important;
  background: linear-gradient(180deg, #f0fdf4, #ffffff) !important;
}

#page-flow-overview .fo-stage-box[data-state='fail'],
#page-flow-overview .fo-check-diamond[data-state='fail'] {
  border-color: rgb(239 68 68 / 0.32) !important;
  background: linear-gradient(180deg, #fff1f2, #ffffff) !important;
}

#page-flow-overview .fo-stage-box[data-state='in_progress'],
#page-flow-overview .fo-check-diamond[data-state='in_progress'] {
  border-color: rgb(245 158 11 / 0.38) !important;
  background: linear-gradient(180deg, #fffbeb, #ffffff) !important;
}

#page-flow-overview .fo-check-diamond {
  border-radius: 20px;
  background: #f8fbff;
  box-shadow: 0 12px 26px rgb(15 43 92 / 0.06);
}

#page-flow-overview .fo-arrow {
  color: var(--ai-blue);
  opacity: .52;
}

#page-flow-overview .fc-flow-legend {
  margin-top: 14px;
  border-color: var(--ai-line);
  border-radius: 18px;
  background: #f8fbff;
}

#page-flow-overview .fo-card {
  padding: 18px;
}

#page-flow-overview .fo-donut {
  box-shadow: inset 0 0 0 22px #fff, 0 0 0 12px rgb(47 125 255 / 0.06), 0 16px 30px rgb(15 43 92 / 0.08);
}

#page-flow-overview .fo-rank-table th {
  color: var(--ai-sub);
  font-weight: 900;
}

#page-flow-overview .fo-rank-table td {
  color: #334155;
}

#page-flow-overview .fo-quick-grid button {
  min-height: 58px;
  border: 1px solid var(--ai-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ai-blue);
  font-weight: 900;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.035);
}

#page-flow-overview .fo-quick-grid button:nth-child(2),
#page-flow-overview .fo-quick-grid button:nth-child(3),
#page-flow-overview .fo-quick-grid button:nth-child(4) {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

@media (max-width: 760px) {
  #page-flow-overview .fo-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* OQC · SN 绑定 · OQC SN Binding Command Center */
#page-oqc-sn {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-oqc-sn .oqc-command-page {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

body.layout-pro #page-oqc-sn .oqc-hero,
body.layout-pro #page-oqc-sn .oqc-summary-grid {
  display: flex;
}

body.layout-pro #page-oqc-sn .oqc-summary-grid {
  display: grid;
}

body.layout-pro #page-oqc-sn .oqc-hero {
  margin-bottom: 0 !important;
}

#page-oqc-sn .oqc-hero,
#page-oqc-sn .oqc-scan-card,
#page-oqc-sn .oqc-empty-guide,
#page-oqc-sn .oqc-gate-card,
#page-oqc-sn .oqc-panel,
#page-oqc-sn .oqc-actions {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-oqc-sn .oqc-hero {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-oqc-sn .oqc-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-oqc-sn .oqc-hero > * {
  position: relative;
  z-index: 1;
}

#page-oqc-sn .oqc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .04em;
  line-height: 1.2 !important;
  text-transform: none;
}

#page-oqc-sn .oqc-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-oqc-sn .oqc-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-oqc-sn .oqc-hero p:not(.oqc-hero-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-oqc-sn .oqc-hero-tags,
#page-oqc-sn .oqc-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-oqc-sn .oqc-hero-tags {
  margin-top: 14px;
}

#page-oqc-sn .oqc-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-oqc-sn .oqc-hero-status {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.82);
  border: 1px solid rgb(47 125 255 / 0.12);
  color: var(--ai-blue) !important;
  font-size: 13px !important;
  font-weight: 850;
}

#page-oqc-sn .oqc-empty-guide {
  padding: 18px 20px !important;
}

#page-oqc-sn .oqc-step-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ai-sub);
  line-height: 1.7;
}

#page-oqc-sn .oqc-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#page-oqc-sn .oqc-advanced-tools {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgb(47 125 255 / 0.14);
}

#page-oqc-sn .oqc-advanced-tools summary {
  cursor: pointer;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 800;
}

#page-oqc-sn .oqc-advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#page-oqc-sn .oqc-flow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--ai-line);
  border-radius: 20px;
  background: #fff;
}

#page-oqc-sn .oqc-flow-step {
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--ai-line);
  background: #f8fbff;
  text-align: center;
}

#page-oqc-sn .oqc-flow-step span {
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 850;
}

#page-oqc-sn .oqc-flow-step.is-active {
  border-color: rgb(47 125 255 / 0.28);
  background: #eaf4ff;
}

#page-oqc-sn .oqc-flow-step.is-active span {
  color: var(--ai-blue);
}

#page-oqc-sn .oqc-flow-step.is-done {
  border-color: rgb(34 197 94 / 0.24);
  background: #ecfdf3;
}

#page-oqc-sn .oqc-flow-step.is-done span {
  color: #15803d;
}

#page-oqc-sn .oqc-flow-step.is-danger {
  border-color: rgb(239 68 68 / 0.24);
  background: #fff1f2;
}

#page-oqc-sn .oqc-flow-arrow {
  color: var(--ai-muted);
  font-size: 14px;
  font-weight: 900;
}

#page-oqc-sn .oqc-gate-card {
  padding: 16px 18px !important;
}

#page-oqc-sn .oqc-gate-hint {
  margin: 0 0 10px;
}

#page-oqc-sn .oqc-gate-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#page-oqc-sn .oqc-gate {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--ai-line);
  background: #fff;
}

#page-oqc-sn .oqc-gate-ok {
  border-color: rgb(34 197 94 / 0.22);
  background: #f0fdf4;
}

#page-oqc-sn .oqc-gate-pending {
  border-color: rgb(245 158 11 / 0.22);
  background: #fffbeb;
}

#page-oqc-sn .oqc-gate-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 950;
  flex-shrink: 0;
}

#page-oqc-sn .oqc-gate-ok .oqc-gate-icon {
  background: #dcfce7;
  color: #15803d;
}

#page-oqc-sn .oqc-gate-pending .oqc-gate-icon {
  background: #fef3c7;
  color: #b45309;
}

#page-oqc-sn .oqc-gate-copy strong {
  display: block;
  color: var(--ai-text);
  font-size: 13px;
}

#page-oqc-sn .oqc-gate-copy small {
  display: block;
  margin-top: 3px;
  color: var(--ai-muted);
  font-size: 11px;
  line-height: 1.45;
}

#page-oqc-sn .oqc-curve-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: var(--ai-muted);
  font-size: 13px;
  border: 1px dashed rgb(47 125 255 / 0.16);
  border-radius: 18px;
  background: #f8fbff;
}

#page-oqc-sn .oqc-summary-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#page-oqc-sn .oqc-summary {
  position: relative;
  min-height: 96px;
  padding: 16px 16px 14px 64px;
  border: 1px solid var(--ai-line);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 24px rgb(15 43 92 / 0.04);
}

#page-oqc-sn .oqc-summary::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: var(--oqc-kpi-bg, #e8f3ff);
}

#page-oqc-sn .oqc-summary::after {
  content: '';
  position: absolute;
  left: 27px;
  top: 29px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--oqc-kpi-color, var(--ai-blue));
}

#page-oqc-sn .oqc-summary-cyan { --oqc-kpi-color: #22d3ee; --oqc-kpi-bg: #e6f7ff; }
#page-oqc-sn .oqc-summary-blue { --oqc-kpi-color: #1677ff; --oqc-kpi-bg: #e8f3ff; }
#page-oqc-sn .oqc-summary-green { --oqc-kpi-color: #22c55e; --oqc-kpi-bg: #ecfdf3; }
#page-oqc-sn .oqc-summary-orange { --oqc-kpi-color: #f59e0b; --oqc-kpi-bg: #fff7e6; }

#page-oqc-sn .oqc-summary span {
  display: block;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 900;
}

#page-oqc-sn .oqc-summary strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--oqc-kpi-color, var(--ai-blue));
  font-size: 24px;
  font-weight: 950;
  line-height: 1.1;
}

#page-oqc-sn .oqc-summary small {
  display: block;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
}

#page-oqc-sn .oqc-kpi-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#page-oqc-sn .oqc-kpi {
  position: relative;
  min-height: 108px;
  padding: 18px 18px 16px 68px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
  text-align: left;
}

#page-oqc-sn .oqc-kpi::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: var(--oqc-kpi-bg, #e8f3ff);
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-oqc-sn .oqc-kpi::after {
  content: '';
  position: absolute;
  left: 30px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--oqc-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.78);
}

#page-oqc-sn .oqc-kpi-cyan { --oqc-kpi-color: #22d3ee; --oqc-kpi-bg: #e6f7ff; }
#page-oqc-sn .oqc-kpi-blue { --oqc-kpi-color: #1677ff; --oqc-kpi-bg: #e8f3ff; }
#page-oqc-sn .oqc-kpi-green { --oqc-kpi-color: #22c55e; --oqc-kpi-bg: #ecfdf3; }
#page-oqc-sn .oqc-kpi-orange { --oqc-kpi-color: #f59e0b; --oqc-kpi-bg: #fff7e6; }

#page-oqc-sn .oqc-kpi span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 900;
}

#page-oqc-sn .oqc-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--oqc-kpi-color, var(--ai-blue));
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
}

#page-oqc-sn .oqc-kpi small {
  display: block;
  max-width: 100%;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  word-break: keep-all;
}

/* 选中态边框已足够明显，不再追加「 · 已筛选」避免说明文字重叠 */
#page-oqc-sn .oqc-kpi.kpi-filter-btn small {
  display: block !important;
  width: auto !important;
  max-width: 100%;
  line-height: 1.4;
  white-space: normal;
  word-break: keep-all;
}

#page-oqc-sn .oqc-kpi.kpi-filter-btn.is-active small::after {
  content: none !important;
}

#page-oqc-sn .oqc-kpi.kpi-filter-btn.is-active small {
  display: block !important;
  width: auto !important;
  max-width: 100%;
  padding: 4px 8px !important;
}

#page-oqc-sn .oqc-scan-card {
  padding: 20px !important;
}

#page-oqc-sn .oqc-card-head,
#page-oqc-sn .card-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
  color: var(--ai-text);
  font-weight: 950;
}

#page-oqc-sn .oqc-card-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-oqc-sn .oqc-scan-card .filter-row {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#page-oqc-sn .oqc-sn-input {
  max-width: none;
  min-height: 42px;
  border: 1px solid rgb(47 125 255 / 0.12) !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.025);
}

#page-oqc-sn .oqc-panels {
  gap: 16px;
}

#page-oqc-sn .oqc-panel {
  overflow: hidden;
  padding: 18px !important;
}

#page-oqc-sn .oqc-pre-short,
#page-oqc-sn .oqc-meas-wrap,
#page-oqc-sn .oqc-curve-host {
  border: 1px solid var(--ai-line);
  border-radius: 20px;
  background: #f8fbff;
}

#page-oqc-sn .oqc-curve-host {
  display: grid;
  place-items: center;
  padding: 12px;
}

#page-oqc-sn .oqc-curve-host svg {
  border-color: var(--ai-line);
  border-radius: 18px;
  background: #ffffff;
}

#page-oqc-sn .oqc-curve-json {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

#page-oqc-sn .oqc-curve-json summary {
  cursor: pointer;
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 950;
}

#page-oqc-sn .oqc-textarea {
  min-height: 120px;
  border: 1px solid rgb(47 125 255 / 0.14) !important;
  border-radius: 16px !important;
  background: #ffffff !important;
}

#page-oqc-sn .oqc-actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  padding: 14px 16px !important;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#page-oqc-sn .oqc-actions-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-oqc-sn .oqc-action-reasons {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.55;
}

#page-oqc-sn .oqc-action-reasons-error {
  border: 1px solid rgb(239 68 68 / 0.22);
  background: #fff1f2;
  color: #9f1239;
}

#page-oqc-sn .oqc-action-reasons-success {
  border: 1px solid rgb(34 197 94 / 0.22);
  background: #f0fdf4;
  color: #166534;
}

#page-oqc-sn .oqc-action-reasons ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

#page-oqc-sn #oqc-action-msg {
  color: var(--ai-sub);
  font-weight: 800;
}

@media (max-width: 960px) {
  #page-oqc-sn .oqc-summary-grid,
  #page-oqc-sn .oqc-kpi-grid,
  #page-oqc-sn .oqc-panels,
  #page-oqc-sn .oqc-gate-list {
    grid-template-columns: 1fr;
  }

  #page-oqc-sn .oqc-hero {
    flex-direction: column;
  }
}

/* 全局顶部二级导航 · Context Navigation Bar */
body.layout-pro .erp-main-chrome {
  margin: 8px 16px 8px !important;
  padding: 6px 10px !important;
  border: 1px solid var(--pro-border-soft) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04) !important;
  backdrop-filter: none;
}

body.layout-pro .erp-main-chrome {
  padding: 0 10px !important;
}

body.layout-pro .erp-nav-bar {
  min-height: 40px;
  padding: 4px 0 !important;
}

/* 列表/工作台页已有本地标题与操作区，隐藏重复的顶部页栏；详情页仍保留返回导航。 */
body.layout-pro:has(:is(
  #page-dashboard,
  #page-my-tasks,
  #page-completed,
  #page-products,
  #page-mdm-params,
  #page-inspection-rules,
  #page-process-inspectors,
  #page-supplier-products,
  #page-ai-review,
  #page-mdm-sampling,
  #page-mdm-tags,
  #page-mdm-product-categories,
  #page-mdm-partners,
  #page-mdm-status,
  #page-entry,
  #page-create-task,
  #page-task-query,
  #page-flow-overview,
  #page-order-flow,
  #page-qc-trace,
  #page-oqc-sn,
  #page-templates,
  #page-stats-cpk,
  #page-stats-merge,
  #page-instruments,
  #page-msa,
  #page-cal-reminders,
  #page-auto-rules,
  #page-kanbans,
  #page-kingdee-sync,
  #page-offline-import,
  #page-test-center,
  #page-users-admin
):not(.hidden)) .erp-main-chrome {
  display: none;
}

/* 详情页返回：比纯灰字链更清楚，但不与主 CTA 抢层级 */
body.layout-pro .erp-back-btn,
body.layout-erp .erp-back-btn {
  min-height: 32px;
  padding: 6px 12px !important;
  border: 1px solid #d7e0ec !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  gap: 6px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

body.layout-pro .erp-back-btn:hover,
body.layout-erp .erp-back-btn:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

body.layout-pro .erp-back-btn svg,
body.layout-erp .erp-back-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.25;
}

body.layout-pro .erp-nav-current {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: var(--ai-blue) !important;
}

body.layout-pro .erp-refresh-btn {
  width: 30px !important;
  height: 28px;
  margin: 2px 4px 2px 2px !important;
  border: 1px solid rgb(47 125 255 / 0.10) !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #708197;
}

body.layout-pro .erp-refresh-btn:hover {
  color: var(--ai-blue);
  border-color: rgb(47 125 255 / 0.28) !important;
  background: #f4f8ff !important;
}

/* 订单流程看板 Hero 最终优化：正常流 AI 标签与安全间距 */
#page-order-flow .order-flow-hero {
  position: relative;
  overflow: hidden;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between;
  min-height: 128px;
  margin: 0 0 14px !important;
  padding: 24px !important;
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.16), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-order-flow .order-flow-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -58px;
  width: 176px;
  height: 176px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.05);
  pointer-events: none;
}

#page-order-flow .order-flow-hero > * {
  position: relative;
  z-index: 1;
}

#page-order-flow .order-flow-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-order-flow .order-flow-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-order-flow .order-flow-title {
  margin: 4px 0 8px !important;
  color: var(--ai-text) !important;
  font-size: 26px !important;
  font-weight: 950 !important;
  letter-spacing: -0.03em !important;
}

#page-order-flow .order-flow-lead {
  max-width: 760px !important;
  color: var(--ai-sub) !important;
  font-size: 13px !important;
  line-height: 1.62 !important;
}

#page-order-flow .order-flow-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-order-flow .order-flow-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

/* 工序能力 CPK · CPK Analysis Command Center */
#page-stats-cpk {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-stats-cpk .stats-cpk-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#page-stats-cpk .stats-cpk-hero,
#page-stats-cpk .stats-page-toolbar,
#page-stats-cpk .stats-side-card,
#page-stats-cpk .stats-config-grid,
#page-stats-cpk .stats-summary-placeholder,
#page-stats-cpk .stats-chart-slot {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-stats-cpk .stats-cpk-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-stats-cpk .stats-cpk-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-stats-cpk .stats-cpk-hero > * {
  position: relative;
  z-index: 1;
}

#page-stats-cpk .stats-cpk-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-stats-cpk .stats-cpk-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-stats-cpk .stats-cpk-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-stats-cpk .stats-cpk-hero p:not(.stats-cpk-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-stats-cpk .stats-cpk-tags,
#page-stats-cpk .stats-cpk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-stats-cpk .stats-cpk-tags {
  margin-top: 14px;
}

#page-stats-cpk .stats-cpk-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-stats-cpk .stats-cpk-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

#page-stats-cpk .stats-cpk-kpi:not(.is-active) {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-stats-cpk .stats-cpk-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--cpk-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-stats-cpk .stats-cpk-kpi-blue { --cpk-kpi-color: #1677ff; }
#page-stats-cpk .stats-cpk-kpi-green { --cpk-kpi-color: #22c55e; }
#page-stats-cpk .stats-cpk-kpi-orange { --cpk-kpi-color: #f59e0b; }
#page-stats-cpk .stats-cpk-kpi-purple { --cpk-kpi-color: #8b5cf6; }

#page-stats-cpk .stats-cpk-kpi span,
#page-stats-cpk .stats-cpk-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-stats-cpk .stats-cpk-kpi:not(.is-active) strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-stats-cpk .stats-page-toolbar {
  padding: 20px !important;
}

#page-stats-cpk .stats-page-toolbar::before {
  content: none !important;
  display: none !important;
}

#page-stats-cpk .stats-console-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
}

#page-stats-cpk .stats-console-head strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#page-stats-cpk .stats-console-head p {
  margin: 5px 0 0;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-stats-cpk .stats-split {
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 16px;
}

#page-stats-cpk .stats-side-card,
#page-stats-cpk .stats-config-grid,
#page-stats-cpk .stats-summary-placeholder,
#page-stats-cpk .stats-chart-slot {
  overflow: hidden;
}

#page-stats-cpk .stats-side-head {
  padding: 14px 16px;
  border-bottom: 1px solid #edf3fb;
  color: var(--ai-text);
  font-weight: 950;
}

#page-stats-cpk .stats-config-grid {
  padding: 16px;
}

#page-stats-cpk .stats-kv {
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 18px;
  background: #ffffff;
}

#page-stats-cpk .stats-kv span {
  color: var(--ai-sub);
  font-weight: 800;
}

#page-stats-cpk .stats-kv em {
  margin-top: 4px;
  color: var(--ai-text);
  font-size: 20px;
  font-weight: 950;
}

#page-stats-cpk .stats-summary-placeholder {
  min-height: 168px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

#page-stats-cpk .stats-summary-placeholder strong {
  color: var(--ai-text);
  font-size: 15px;
  font-weight: 950;
}

#page-stats-cpk .stats-empty-orb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 0 12px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

#page-stats-cpk .stats-chart-slot {
  min-height: 240px;
  border-radius: 28px !important;
}

@media (max-width: 960px) {
  #page-stats-cpk .stats-cpk-hero {
    flex-direction: column;
  }

  #page-stats-cpk .stats-cpk-kpi-grid,
  #page-stats-cpk .stats-split {
    grid-template-columns: 1fr;
  }
}

/* 合并汇总 · Merge Summary Command Center */
#page-stats-merge {
  background:
    radial-gradient(circle at 12% 0%, rgb(47 125 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-stats-merge .stats-merge-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#page-stats-merge .stats-merge-hero,
#page-stats-merge .stats-merge-workspace {
  border: 1px solid var(--ai-line) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.10), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-stats-merge .stats-merge-workspace .stats-merge-pending,
#page-stats-merge .stats-merge-workspace .stats-merge-body {
  border: 1px solid #e8eff8 !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8) !important;
}

#page-stats-merge .stats-merge-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-stats-merge .stats-merge-hero::after {
  content: '';
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgb(47 125 255 / 0.055);
  pointer-events: none;
}

#page-stats-merge .stats-merge-hero > * {
  position: relative;
  z-index: 1;
}

#page-stats-merge .stats-merge-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-stats-merge .stats-merge-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-stats-merge .stats-merge-hero h2 {
  margin: 4px 0 8px;
  color: var(--ai-text);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#page-stats-merge .stats-merge-hero p:not(.stats-merge-badge) {
  max-width: 760px;
  margin: 0;
  color: var(--ai-sub);
  line-height: 1.62;
}

#page-stats-merge .stats-merge-tags,
#page-stats-merge .stats-merge-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-stats-merge .stats-merge-tags {
  margin-top: 14px;
}

#page-stats-merge .stats-merge-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-stats-merge .stats-merge-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

#page-stats-merge .stats-merge-kpi:not(.is-active) {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
}

#page-stats-merge .stats-merge-kpi::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--merge-kpi-color, var(--ai-blue));
  box-shadow: 0 0 0 8px rgb(47 125 255 / 0.06);
}

#page-stats-merge .stats-merge-kpi-blue { --merge-kpi-color: #1677ff; }
#page-stats-merge .stats-merge-kpi-green { --merge-kpi-color: #22c55e; }
#page-stats-merge .stats-merge-kpi-orange { --merge-kpi-color: #f59e0b; }
#page-stats-merge .stats-merge-kpi-purple { --merge-kpi-color: #8b5cf6; }

#page-stats-merge .stats-merge-kpi span,
#page-stats-merge .stats-merge-kpi small {
  display: block;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-stats-merge .stats-merge-kpi:not(.is-active) strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

#page-stats-merge .stats-merge-workspace {
  padding: 0 !important;
  overflow: hidden;
}

#page-stats-merge .stats-merge-workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #edf3fb;
  background:
    linear-gradient(90deg, #ffffff, #f8fbff),
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 12rem);
}

#page-stats-merge .stats-merge-workspace-kicker {
  display: inline-flex;
  margin: 0 0 4px;
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
}

#page-stats-merge .stats-merge-workspace-intro h3 {
  margin: 0 0 6px;
  color: var(--ai-text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

#page-stats-merge .stats-merge-workspace-intro p {
  margin: 0;
  max-width: 520px;
  color: var(--ai-sub);
  font-size: 12px;
  line-height: 1.55;
}

#page-stats-merge .stats-merge-workspace-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#page-stats-merge .stats-merge-export-link {
  color: var(--ai-sub) !important;
  font-weight: 700 !important;
}

#page-stats-merge .stats-merge-policy-details {
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #edf3fb;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#page-stats-merge .stats-merge-policy-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

#page-stats-merge .stats-merge-policy-summary::-webkit-details-marker {
  display: none;
}

#page-stats-merge .stats-merge-policy-summary::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  margin-right: 2px;
  transform: rotate(-45deg);
  transition: transform .16s var(--ease-out);
}

#page-stats-merge .stats-merge-policy-details[open] .stats-merge-policy-summary::before {
  transform: rotate(45deg);
}

#page-stats-merge .stats-merge-policy-summary-main {
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 800;
}

#page-stats-merge .stats-merge-policy-summary-meta {
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 600;
}

#page-stats-merge .stats-merge-policy-body {
  padding: 0 20px 16px 36px;
}

#page-stats-merge .stats-merge-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 148px;
}

#page-stats-merge .stats-merge-field > span {
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 750;
}

#page-stats-merge .stats-merge-field select {
  min-width: 132px;
  padding: 8px 32px 8px 12px;
  border: 1px solid rgb(47 125 255 / 0.14);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 700;
  appearance: none;
}

#page-stats-merge .stats-merge-split {
  padding: 16px;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 16px;
}

#page-stats-merge .stats-pending-tag {
  margin: 14px 16px 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-weight: 950;
}

#page-stats-merge .stats-merge-body {
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

#page-stats-merge .stats-merge-body strong {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 950;
}

@media (max-width: 960px) {
  #page-stats-merge .stats-merge-hero {
    flex-direction: column;
  }

  #page-stats-merge .stats-merge-workspace-head {
    flex-direction: column;
  }

  #page-stats-merge .stats-merge-workspace-tools {
    justify-content: flex-start;
  }

  #page-stats-merge .stats-merge-kpi-grid,
  #page-stats-merge .stats-merge-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #page-create-task .ct-hero,
  #page-create-task .ct-hero-main,
  #page-create-task .ct-hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* ── 检验追溯 (qc-trace) ── */
.qt-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.qt-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
}

.qt-hero-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex: 1;
  min-width: 240px;
}

.qt-hero-icon {
  font-size: 28px;
  line-height: 1;
  opacity: 0.85;
}

.qt-hero-badge {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--primary));
}

.qt-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.qt-hero p {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  line-height: 1.5;
  max-width: 560px;
}

.qt-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 280px;
}

.qt-search input {
  flex: 1;
  min-width: 200px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  font-size: 14px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  outline: none;
}

.qt-search input::placeholder {
  color: hsl(var(--muted-foreground));
}

.qt-search input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

.qt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.qt-kpi {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qt-kpi span:first-child {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-weight: 700;
}

.qt-kpi strong {
  font-size: 24px;
  font-weight: 900;
  color: hsl(var(--foreground));
}

.qt-kpi small {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.qt-meta {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qt-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  font-size: 13px;
}

.qt-meta-row > span:first-child {
  min-width: 72px;
  color: hsl(var(--muted-foreground));
  font-weight: 700;
}

.qt-meta-actions {
  margin-top: 4px;
}

.qt-stages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qt-stage-card {
  padding: 0;
  overflow: hidden;
}

.qt-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid hsl(var(--border));
}

.qt-stage-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.qt-stage-type {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.04em;
}

.qt-task-list {
  padding: 8px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qt-task-details {
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: hsl(var(--muted) / 0.35);
  overflow: hidden;
}

.qt-task-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
}

.qt-task-summary::-webkit-details-marker {
  display: none;
}

.qt-task-no {
  font-weight: 800;
}

.qt-task-body {
  padding: 0 12px 12px;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.qt-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.qt-task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.qt-pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 800;
}

.qt-pill-link {
  text-decoration: none;
}

.qt-pill-link:hover {
  background: #dbeafe;
}

.qt-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.qt-meas-wrap {
  max-height: 320px;
  overflow: auto;
}

.qt-meas-pass td:nth-child(4) {
  color: #15803d;
  font-weight: 700;
}

.qt-meas-fail td:nth-child(4) {
  color: #b91c1c;
  font-weight: 700;
}

.qt-empty {
  padding: 24px;
  text-align: center;
}

@media (max-width: 900px) {
  .qt-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .qt-hero {
    flex-direction: column;
  }
  .qt-search {
    width: 100%;
  }
}

/* 检验追溯 · Traceability Command Center */
#page-qc-trace {
  background:
    radial-gradient(circle at 12% 0%, rgb(22 119 255 / 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #f5f7fb 100%);
}

#page-qc-trace .qt-page {
  gap: 16px;
  width: 100%;
  max-width: none;
}

body.layout-pro #page-qc-trace .task-command-hero {
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 16px !important;
  min-height: 0 !important;
}

#page-qc-trace .qt-hero {
  align-items: flex-start !important;
  padding: 24px !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 96% 0%, rgb(34 211 238 / 0.18), transparent 16rem),
    radial-gradient(circle at 0% 100%, rgb(47 125 255 / 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

#page-qc-trace .qt-hero > * {
  position: relative;
  z-index: 1;
}

#page-qc-trace .qt-hero-main {
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  flex: none;
}

#page-qc-trace .qt-hero-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-top: 4px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ai-blue), #22d3ee);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 0 0 10px rgb(47 125 255 / 0.08), 0 16px 30px rgb(47 125 255 / 0.22);
}

#page-qc-trace .qt-hero h2 {
  margin-top: 4px !important;
  font-size: 26px !important;
}

#page-qc-trace .qt-hero p:not(.qt-hero-badge) {
  max-width: none;
  line-height: 1.6;
}

#page-qc-trace .qt-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue) !important;
  font-size: 11px !important;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

#page-qc-trace .qt-hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 4px rgb(34 211 238 / 0.12);
}

#page-qc-trace .qt-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#page-qc-trace .qt-hero-tags span {
  padding: 5px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ai-blue);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.04);
}

#page-qc-trace .qt-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
  align-self: stretch;
}

#page-qc-trace .qt-search input {
  flex: 1 1 240px;
  /* 输入框被 qcos-field-clear-wrap 包裹后不再是 flex 子项，需 100% 撑满 wrap */
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 42px;
  border: 1px solid rgb(47 125 255 / 0.12) !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 6px 16px rgb(15 43 92 / 0.025);
}

#page-qc-trace .qt-search input:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

#page-qc-trace .qt-kpi {
  min-height: 96px;
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-qc-trace .qt-meta.card {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-qc-trace .qt-stage-card.card {
  border-color: var(--ai-line) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 28px rgb(15 43 92 / 0.04) !important;
}

@media (max-width: 900px) {
  #page-qc-trace .qt-hero,
  #page-qc-trace .qt-hero-main,
  #page-qc-trace .qt-search {
    width: 100%;
  }

  #page-qc-trace .qt-search input {
    width: 100%;
  }
}

/* ---- 检验全景 · 上线清单 ---- */
.qc-overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #fff;
}

.qc-overview-kpi {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  color: #172033;
  font-size: 13px;
  line-height: 1.5;
}

.qc-overview-kpi strong {
  font-size: 14px;
  font-weight: 750;
  color: #1e293b;
}

.qc-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.qc-overview-more {
  position: relative;
}

.qc-overview-more > summary {
  list-style: none;
  cursor: pointer;
}

.qc-overview-more > summary::-webkit-details-marker {
  display: none;
}

.qc-overview-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(320px, 78vw);
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.1);
}

.qc-overview-more-panel .qc-overview-structure-readonly {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.qc-overview-more-panel .qc-overview-structure-readonly.hidden {
  display: none;
}

.qc-overview-more-panel > .btn {
  justify-content: flex-start;
}

.qc-overview-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qc-overview-mode-wrap select {
  min-width: 7.5rem;
}

.qc-overview-hybrid-policy {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-muted, #f8fafc);
}

.qc-overview-hybrid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 12px;
  margin: 8px 0 10px;
}

.qc-overview-hybrid-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.qc-overview-hybrid-grid select {
  min-width: 0;
}

.qc-overview-notes {
  margin: 0 0 10px;
}

.qc-overview-notes-line {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.qc-go-live-panel {
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.qc-go-live-panel--slim,
.qc-go-live-panel--compact {
  box-shadow: none;
}

.qc-go-live-panel--pending {
  border-color: #f1e4c8;
  background: #fffdf8;
}

.qc-go-live-panel--ready {
  border-color: #d8ebe0;
  background: #f8fcf9;
}

.qc-go-live-ready-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 12px;
}

.qc-go-live-ready-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  flex: 1 1 240px;
  min-width: 0;
}

.qc-go-live-ready-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.qc-go-live-ready-title-row .qc-go-live-title {
  margin: 0;
  font-size: 15px;
}

.qc-go-live-bar-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.qc-go-live-ready-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.qc-go-live-pct-inline {
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.qc-go-live-pct-inline strong {
  margin-left: 2px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
}

.qc-go-live-pct-inline--muted,
.qc-go-live-pct-inline--muted strong {
  color: #64748b;
  font-weight: 600;
}

.qc-go-live-kpi--primary {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.qc-go-live-kpi--muted {
  opacity: 0.88;
}

.qc-go-live-kpi--muted .qc-go-live-kpi-val {
  color: #64748b;
  font-size: 18px;
}

.qc-go-live-pending-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.qc-go-live-pending-chip.is-pending {
  border-color: #f1e4c8;
  background: #fffbeb;
  color: #b45309;
}

.qc-go-live-pending-chip.is-ready {
  border-color: #d8ebe0;
  background: #f0fdf4;
  color: #15803d;
}

.qc-go-live-ready-badge {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.qc-go-live-details {
  border-top: 1px solid #edf3fb;
  padding: 0 0 4px;
}

.qc-go-live-details .qc-go-live-summary {
  padding: 10px 16px 0;
}

.qc-go-live-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf3fb;
}

.qc-go-live-hero-main {
  flex: 1 1 320px;
  min-width: 0;
}

.qc-go-live-title {
  margin: 0 0 6px;
  color: #172033;
  font-size: 16px;
  font-weight: 850;
}

.qc-go-live-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.qc-go-live-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.qc-go-live-kpi {
  min-width: 88px;
  padding: 10px 14px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.88);
  text-align: center;
}

.qc-go-live-ready-metrics .qc-go-live-kpi {
  min-width: 76px;
  padding: 8px 12px;
}

.qc-go-live-kpi-label {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.qc-go-live-kpi-val {
  display: block;
  margin-top: 4px;
  color: #1677ff;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.qc-go-live-ready-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #d8ebe0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.qc-go-live-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: rgb(255 255 255 / 0.55);
}

.qc-go-live-pending-hint {
  font-size: 12px;
  font-weight: 750;
}

.qc-go-live-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px 18px;
  list-style: none;
  border-bottom: 1px solid #f1f5f9;
  background: #fbfdff;
}

.qc-go-live-steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.qc-go-live-step-no {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgb(22 119 255 / 0.1);
  color: #1677ff;
  font-size: 11px;
  font-weight: 900;
}

.qc-go-live-table {
  width: 100%;
  overflow: hidden;
}

.qc-go-live-table-body {
  display: flex;
  flex-direction: column;
}

.qc-go-live-row {
  display: grid;
  grid-template-columns: 72px minmax(140px, 1.4fr) 88px minmax(160px, 1.6fr) minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  font-size: 12px;
}

.qc-go-live-row:last-child {
  border-bottom: none;
}

.qc-go-live-row-head {
  background: #fbfdff;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qc-go-live-row.ok {
  background: linear-gradient(90deg, rgb(236 253 245 / 0.55), #fff 28%);
}

.qc-go-live-row.missing {
  background: linear-gradient(90deg, rgb(254 242 242 / 0.55), #fff 28%);
}

.qc-go-live-row.optional {
  background: #fafbfc;
}

.qc-go-live-row > * {
  min-width: 0;
  padding: 10px 4px;
}

.qc-go-live-scope {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.qc-go-live-label {
  color: #172033;
  font-weight: 850;
  line-height: 1.45;
}

.qc-go-live-detail {
  line-height: 1.5;
  word-break: break-word;
}

.qc-go-live-action-cell {
  display: flex;
  justify-content: flex-start;
}

.qc-go-live-action {
  white-space: nowrap;
}

.qc-go-live-empty {
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  background: #fff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(15 23 42 / 0.42);
  backdrop-filter: blur(8px);
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  width: min(720px, 94vw);
  max-height: 86vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgb(15 23 42 / 0.24);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.modal-head h3 {
  margin: 0;
  color: #172033;
  font-size: 16px;
}

.ped-quick-rule-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.ped-quick-rule-context-sep {
  color: #cbd5e1;
}

.ped-quick-rule-hint {
  margin: 0 0 10px !important;
}

.ped-quick-rule-existing {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.ped-quick-rule-existing.hidden {
  display: none;
}

.ped-quick-rule-existing strong {
  display: inline;
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.ped-quick-rule-existing span {
  color: #64748b;
}

.ped-quick-rule-existing small {
  display: inline;
  margin-left: 4px;
  color: #94a3b8;
}

.ped-quick-rule-card .ped-quick-rule-template-field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ped-quick-rule-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ped-quick-rule-template-label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.ped-quick-rule-change-btn.hidden {
  display: none !important;
}

.ped-quick-rule-picker:not(.is-open) {
  display: none;
}

.ped-quick-rule-picker.is-open {
  display: grid;
  gap: 10px;
}

.ped-quick-rule-card .ped-quick-rule-template-wrap {
  width: 100%;
}

.ped-quick-rule-card .ped-quick-rule-template-wrap .itr-combo-list {
  z-index: 40;
  max-height: min(280px, 42vh);
  margin-top: 2px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.ped-quick-rule-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.ped-quick-rule-selected.is-empty {
  display: none !important;
}

.ped-quick-rule-selected.is-picked {
  border-color: #93c5fd;
  background: #eff6ff;
}

.ped-quick-rule-selected-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ped-quick-rule-selected-badge {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.ped-quick-rule-selected.is-picked .ped-quick-rule-selected-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.ped-quick-rule-selected-main strong {
  color: #0f172a;
  font-size: 14px;
  word-break: break-word;
}

.ped-quick-rule-selected-main small {
  color: #64748b;
  font-size: 12px;
  word-break: break-word;
}

.ped-quick-rule-selected-open {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: default;
}

.ped-quick-rule-selected.is-picked .ped-quick-rule-selected-open {
  cursor: pointer;
  border-radius: 8px;
}

.ped-quick-rule-selected.is-picked .ped-quick-rule-selected-open:hover strong,
.ped-quick-rule-selected.is-picked .ped-quick-rule-selected-open:focus-visible strong {
  color: #1d4ed8;
  text-decoration: underline;
}

.ped-quick-rule-selected.is-picked .ped-quick-rule-selected-open:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.ped-quick-rule-selected-cta {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.ped-quick-rule-selected-cta.hidden {
  display: none;
}

.ped-quick-rule-card .ped-quick-rule-template-wrap > input[type='text'] {
  width: 100%;
}

.ped-quick-rule-card select,
.ped-quick-rule-card input {
  min-height: 40px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
}

.ped-quick-rule-advanced {
  margin: 2px 0 14px;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.ped-quick-rule-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: #f8fafc;
}

.ped-quick-rule-advanced-summary::-webkit-details-marker,
.ped-quick-rule-advanced-summary::marker {
  display: none;
  content: '';
}

.ped-quick-rule-advanced[open] .ped-quick-rule-advanced-summary {
  border-bottom: 1px solid #eef2f6;
  background: #fff;
}

.ped-quick-rule-advanced-summary-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ped-quick-rule-advanced-summary-main strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}

.ped-quick-rule-advanced-summary-main small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.ped-quick-rule-advanced-chevron {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  position: relative;
}

.ped-quick-rule-advanced-chevron::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.ped-quick-rule-advanced[open] .ped-quick-rule-advanced-chevron::before {
  top: 12px;
  transform: rotate(225deg);
}

.ped-quick-rule-advanced-summary:hover .ped-quick-rule-advanced-chevron {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.ped-quick-rule-advanced-body {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #fafbfc;
}

.ped-quick-rule-advanced-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  background: #fff;
}

.ped-quick-rule-advanced-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.ped-quick-rule-advanced-block-head span {
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.ped-quick-rule-advanced-block-head small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.ped-quick-rule-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.ped-quick-rule-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.ped-quick-rule-field > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.ped-quick-rule-field--wide {
  grid-column: 1 / -1;
}

.ped-quick-rule-field--priority {
  max-width: 180px;
}

.ped-quick-rule-field--priority em {
  font-style: normal;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

.ped-quick-rule-advanced-grid .itr-combo-wrap {
  min-width: 0;
}

.ped-quick-rule-advanced .ped-quick-rule-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 0 11px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}

.ped-quick-rule-advanced .ped-quick-rule-field input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

/* 补规则弹窗上叠检验方案详情（不跳转检验项目库） */
.pqr-template-detail-host {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5200;
}
.pqr-template-detail-host.is-open {
  display: block;
}
.pqr-template-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 0.36);
  backdrop-filter: blur(2px);
}
.pqr-template-detail-stage {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(1040px, 96vw);
  height: 100%;
  overflow: auto;
  background: #f7f9fc;
  box-shadow: -20px 0 45px rgb(15 23 42 / 0.18);
}
.pqr-template-detail-host.is-open #mdmp-template-detail-drawer.mdmp-detail-pane {
  display: block !important;
  width: 100%;
  min-height: 100%;
}
.pqr-template-detail-host.is-open .mdmp-detail-panel-body {
  display: flex !important;
  width: 100%;
  min-height: 100%;
  max-height: none;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff;
}
/* 补规则叠层也走统一顶栏返回，不再隐藏 */
body.pqr-template-overlay-open {
  overflow: hidden;
}
/* 叠层打开时，方案编辑/新增检测项弹窗需压在抽屉之上 */
body.pqr-template-overlay-open #mdm-template-edit-modal,
body.pqr-template-overlay-open #mdm-param-edit,
body.pqr-template-overlay-open #mdm-tpl-create-modal,
body.pqr-template-overlay-open #mdmp-import-items-modal,
body.pqr-template-overlay-open #ped-inspection-pool-modal {
  z-index: 5400;
}

.ped-quick-rule-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ped-quick-rule-actions-left,
.ped-quick-rule-actions-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ped-quick-rule-create {
  display: grid;
  gap: 8px;
  margin: -4px 0 10px;
}

.ped-quick-rule-create.is-empty-primary #pqr-create-template-hint {
  display: block;
}

.ped-quick-rule-library-link {
  font-size: 13px;
}

.itr-combo-item.itr-template-option.is-picked {
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px #93c5fd;
}

.itr-combo-item.itr-combo-create-action {
  margin-top: 4px;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  color: #1d4ed8;
  font-weight: 700;
  background: #f8fbff;
}

.itr-combo-item.itr-combo-create-action:hover,
.itr-combo-item.itr-combo-create-action[aria-selected='true'] {
  background: #eff6ff;
}

@media (max-width: 640px) {
  .ped-quick-rule-readonly,
  .ped-quick-rule-advanced-grid {
    grid-template-columns: 1fr;
  }

  .ped-quick-rule-field--priority {
    max-width: none;
  }

  .ped-quick-rule-actions,
  .ped-quick-rule-actions-left,
  .ped-quick-rule-actions-right {
    flex-direction: column;
    align-items: stretch;
  }
}

.qc-overview-stages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.qc-overview-rules-strip {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.qc-overview-rules-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}

.qc-overview-rules-head strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.qc-overview-rules-head p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.qc-overview-rules-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qc-overview-rules-strip .ped-rule-summary {
  margin: 0;
  color: #334155;
  font-size: 13px;
}

.qc-overview-rules-strip .ped-rule-table-wrap {
  overflow: auto;
  border: 1px solid #e6edf7;
  border-radius: 10px;
  background: #fff;
}

.qc-overview-rules-strip.is-empty {
  padding: 10px 14px;
  background: #f8fafc;
}

.qc-overview-rules-strip.is-empty .qc-overview-rules-sub {
  display: none;
}

.qc-overview-rules-strip.is-empty .qc-overview-rules-actions .btn:not(:first-child) {
  display: none;
}

.qc-overview-rules-strip .ped-rule-table-wrap.hidden {
  display: none !important;
}

.qc-overview-rules-strip .ped-rule-table {
  margin: 0;
}

.qc-stage-card--route-ref {
  background: #f8fafc;
  border-style: dashed;
  box-shadow: none;
}

.qc-stage-route-ref {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.qc-stage-route-ref .btn-link {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 600;
}

.qc-stage-card {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  box-sizing: border-box;
}

.qc-stage-card--compact {
  padding: 10px 14px;
}

.qc-stage-card--compact.is-self .qc-stage-head {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  align-items: center;
}

.qc-stage-card.is-gap {
  border-color: #f1e4c8;
}

.qc-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.qc-stage-head-main {
  flex: 1 1 220px;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.qc-stage-head h4 {
  margin: 0;
  color: #172033;
  font-size: 14px;
  font-weight: 750;
}

.qc-stage-status {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.qc-stage-status--gap {
  color: #b45309;
}

.qc-stage-gap-line {
  margin: 2px 0 0;
  color: #b45309;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}

.qc-stage-status-meta,
.qc-mat-status-meta {
  color: #94a3b8;
  font-weight: 500;
}

.qc-stage-actions,
.qc-mat-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.qc-stage-gaps,
.qc-stage-drawings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.qc-stage-materials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
  width: 100%;
}

.qc-mat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #fbfdff;
}

.qc-mat-card.is-gap {
  border-color: #f1e4c8;
  background: #fffdf8;
}

.qc-mat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.qc-mat-head > .muted-text {
  flex: 1 1 auto;
  min-width: 0;
}

.qc-mat-head .qc-mat-actions {
  margin-left: auto;
}

.qc-mat-scope {
  padding: 1px 6px;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

.qc-mat-status {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.qc-mat-status--gap {
  color: #b45309;
}

.qc-mat-meta {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.qc-mat-rules,
.qc-mat-templates,
.qc-mat-gaps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.qc-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}

.qc-mat-gaps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qc-mat-rule-hint {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.qc-mat-rule-hint .btn-link {
  font-size: 12px;
  font-weight: 600;
}

.qc-mat-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

@media (max-width: 900px) {
  .qc-go-live-row,
  .qc-go-live-row-head {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px;
  }

  .qc-go-live-row-head {
    display: none;
  }

  .qc-go-live-row > * {
    padding: 2px 0;
  }

  .qc-go-live-status,
  .qc-go-live-action-cell {
    justify-self: start;
  }

  .qc-stage-materials,
  .qc-go-live-steps {
    grid-template-columns: 1fr;
  }

  .qc-overview-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .qc-overview-actions {
    justify-content: flex-start;
  }
}

.entry-search-panel.entry-search-panel-collapsed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.entry-search-panel.entry-search-panel-collapsed label,
.entry-search-panel.entry-search-panel-collapsed #entry-finder-options,
.entry-search-panel.entry-search-panel-collapsed .entry-search-actions .btn:not(#entry-search-panel-toggle) {
  display: none;
}

.entry-search-panel.entry-search-panel-collapsed .entry-search-panel-title {
  margin: 0;
}

.entry-search-panel.entry-search-panel-collapsed .entry-search-actions {
  margin: 0;
  justify-content: flex-end;
}

.ct-quick {
  margin: 16px 0;
  padding: 18px;
}

.ct-quick-main {
  display: grid;
  gap: 14px;
}

.ct-quick-step {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f3ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 800;
}

.ct-quick h3 {
  margin: 8px 0 6px;
  color: #0f172a;
  font-size: 22px;
}

.ct-quick p {
  margin: 0;
  color: #64748b;
}

.ct-quick-planned {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
}

.ct-quick-planned li {
  margin: 2px 0;
}

.ct-quick-planned .ct-plan-warn {
  color: #b42318;
  font-weight: 700;
  list-style: none;
  margin-left: -18px;
}

.ct-quick-planned .ct-plan-note {
  list-style: none;
  margin-left: -18px;
  font-size: 12px;
}

.ct-quick-planned .ct-plan-product {
  list-style: none;
  margin: 8px 0 2px -18px;
}

.ct-quick-planned .ct-plan-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.ct-quick-planned .ct-plan-stage small {
  color: #64748b;
  font-size: 12px;
}

.ct-quick-planned .ct-plan-fix {
  padding: 1px 8px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  cursor: pointer;
}

.ct-quick-planned .ct-plan-fix:hover {
  background: #dbeafe;
}

.ct-quick-planned .ct-plan-status {
  display: inline-flex;
  min-width: 72px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.ct-quick-planned .is-will_create .ct-plan-status {
  background: #ecfdf3;
  color: #15803d;
}

.ct-quick-planned .is-via_iqc .ct-plan-status {
  background: #eff6ff;
  color: #1d4ed8;
}

.ct-quick-planned .is-missing_config .ct-plan-status {
  background: #fef3f2;
  color: #b42318;
}

.ct-quick-planned .is-not_needed .ct-plan-status {
  background: #f8fafc;
  color: #94a3b8;
}

.ct-quick-input-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.ct-quick-input {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.ct-quick-input input {
  min-height: 44px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 16px;
}

#page-create-task.ct-advanced-collapsed .ct-main .ct-section,
#page-create-task.ct-advanced-collapsed .ct-main .ct-footer-actions {
  display: none;
}

#page-create-task .ct-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 760px) {
  .ct-quick-input-row {
    grid-template-columns: 1fr;
  }
  #page-create-task .ct-tip {
    align-items: stretch;
    flex-direction: column;
  }
}

#page-product-edit.ped-advanced-collapsed .ped-form-section.ped-advanced-section,
#page-product-edit.ped-advanced-collapsed .ped-advanced-field,
#page-product-edit.ped-advanced-collapsed .prod-field-label,
#page-product-edit.ped-advanced-collapsed #ped-description,
#page-product-edit.ped-advanced-collapsed .ped-lower-layout {
  display: none;
}

#page-product-edit.ped-advanced-collapsed #ped-basic-card .ped-card-head p {
  max-width: 760px;
}

#page-product-edit.ped-advanced-collapsed #ped-basic-card .ped-card-head p::after {
  content: " 默认维护编码、名称、规格、业务分类与工艺路线；质量图纸、状态与流程策略可展开后补齐。";
}

/* 查看态：基础身份/业务分类改为档案摘要，去掉输入框外壳 */
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity,
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify {
  margin: 0 0 18px;
  padding: 0 0 16px;
  border: none;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: transparent;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: none;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity .ped-form-section-head,
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify .ped-form-section-head {
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity .ped-form-section-head > span,
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify .ped-form-section-head > span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity .ped-form-section-head strong,
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify .ped-form-section-head strong {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity .ped-form-section-desc,
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify .ped-form-section-desc {
  display: none;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity .ped-form-grid label,
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify .ped-form-grid label {
  gap: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

/* 需 !important：覆盖 body.layout-erp .app-main input 全局控件皮肤 */
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity input:not([type='file']):not([type='hidden']),
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity select,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify input:not([type='file']):not([type='hidden']),
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify select {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  cursor: default !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity select,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify select {
  background-image: none !important;
  padding-right: 0 !important;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity select:disabled,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify select:disabled,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity input:disabled,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify input:disabled,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity input:read-only,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify input:read-only {
  opacity: 1 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

#page-product-edit.ped-mode-view #ped-basic-card input:not([type='file']):not([type='hidden']),
#page-product-edit.ped-mode-view #ped-basic-card select,
#page-product-edit.ped-mode-view #ped-basic-card textarea {
  background: #f8fafc;
  color: #334155;
  cursor: default;
  border-color: #e2e8f0;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity input:focus,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--identity select:focus,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify input:focus,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--classify select:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

#page-product-edit.ped-mode-view #ped-basic-card input:not([type='file']):focus,
#page-product-edit.ped-mode-view #ped-basic-card select:focus,
#page-product-edit.ped-mode-view #ped-basic-card textarea:focus {
  box-shadow: none;
  border-color: #e2e8f0;
}

#page-product-edit.ped-mode-view .ped-view-hint {
  display: block;
}

/* 图纸与材质 / 更多资料查看态：摘要化，去掉表单外壳 */
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing,
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more {
  margin: 0;
  padding: 4px 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing .ped-form-section-desc {
  display: none;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing .ped-form-section-head--plain strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing .ped-form-grid label {
  gap: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing input:not([type='file']):not([type='hidden']),
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing textarea {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  resize: none !important;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing input:read-only,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing textarea:read-only {
  opacity: 1 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing label:has(input:placeholder-shown):not(:has(#ped-drawing)),
#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing label:has(textarea:placeholder-shown) {
  display: none;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--drawing label[data-ped-field='drawing']:has(#ped-drawing:placeholder-shown) {
  display: none;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-drawing-status {
  margin-bottom: 18px;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more .ped-form-section-desc {
  display: none;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more .ped-form-section-head--plain strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more .ped-form-grid label {
  gap: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more input:not([type='file']):not([type='hidden']),
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more select,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more textarea {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  resize: none !important;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more select {
  background-image: none !important;
}

body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more select:disabled,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more input:disabled,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more input:read-only,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more textarea:disabled,
body.layout-erp #page-product-edit.ped-mode-view #ped-basic-card .ped-form-section--more textarea:read-only {
  opacity: 1 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-more-admin-row {
  margin-top: 12px;
  padding-top: 12px;
}

#page-product-edit.ped-mode-view #ped-basic-card .ped-more-notes {
  margin-top: 12px;
  padding-top: 12px;
}

/* 查看态：空禁用原因 / 空补充说明不占位 */
#page-product-edit.ped-mode-view #ped-basic-card .ped-disabled-reason-field:has(#ped-disabled-reason:placeholder-shown),
#page-product-edit.ped-mode-view #ped-basic-card .ped-more-notes:has(#ped-description:placeholder-shown) {
  display: none;
}

.ped-workspace[data-ped-ws='more'] .ped-side-column .ped-side-card:first-child {
  /* 概览与页头重复，更多资料页压缩展示 */
  padding: 12px 14px;
}

.ped-workspace[data-ped-ws='more'] .ped-side-column .ped-overview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 6px;
}

.ped-workspace[data-ped-ws='more'] .ped-side-column .ped-overview dt,
.ped-workspace[data-ped-ws='more'] .ped-side-column .ped-overview dd {
  margin: 0;
  padding: 0;
  border: none;
}

.ped-workspace[data-ped-ws='more'] .ped-side-column .ped-overview dt {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.ped-workspace[data-ped-ws='more'] .ped-side-column .ped-overview dd {
  color: #0f172a;
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
  #ped-basic-card .ped-form-grid--identity {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #ped-basic-card .ped-form-grid--classify {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  #ped-basic-card .ped-form-grid--more-status,
  #ped-basic-card .ped-form-grid--drawing-meta,
  #ped-basic-card .ped-form-grid--drawing-notes {
    grid-template-columns: 1fr 1fr;
    max-width: none;
  }

  .ped-drawing-status {
    flex-direction: column;
  }

  .ped-drawing-status-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  #ped-basic-card .ped-form-grid--identity,
  #ped-basic-card .ped-form-grid--classify,
  #page-product-edit.ped-mode-edit #ped-basic-card .ped-form-grid--classify,
  #ped-basic-card .ped-form-grid--more-status,
  #ped-basic-card .ped-form-grid--drawing-meta,
  #ped-basic-card .ped-form-grid--drawing-notes {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .ped-more-admin-row {
    flex-direction: column;
  }

  .ped-more-query-body {
    flex-direction: column;
    align-items: stretch;
  }
}

.avl-outsourced-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.avl-outsourced-head strong {
  color: #0f172a;
}

.avl-outsourced-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.avl-outsourced-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.avl-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.tiny {
  font-size: 11px;
}

@media (max-width: 980px) {
  .avl-outsourced-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .avl-outsourced-fields {
    grid-template-columns: 1fr;
  }
}

/* ==================== 测试中心 ==================== */
.test-center-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.test-center-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.test-center-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.test-center-section-head > strong {
  font-size: 15px;
}
#tc-guard-hint.tc-guard-locked {
  color: #b45309;
  font-weight: 600;
}
.tc-scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.tc-scenario-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg, #fff);
}
.tc-scenario-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tc-scenario-card p {
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.tc-scenario-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tc-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.tc-summary-total {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--text-secondary, #64748b);
}
.tc-summary-total strong {
  font-size: 18px;
  color: var(--primary, #2563eb);
}
.tc-summary-cell {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tc-summary-cell span {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}
.tc-summary-cell strong {
  font-size: 18px;
}
.tc-actions,
.tc-gen-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tc-gen-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}
.tc-gen-form input,
.tc-gen-form select {
  min-width: 120px;
}
.tc-loading,
.tc-empty {
  color: var(--text-secondary, #94a3b8);
  padding: 16px;
  text-align: center;
}
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 报告模板预览 · 与 AI Native 工业 SaaS 视觉层对齐 */
#reporttpl-preview-modal {
  padding: 20px;
  background: rgb(15 23 42 / 0.46);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#reporttpl-preview-modal .reporttpl-preview-modal {
  width: min(1080px, calc(100vw - 40px));
  max-width: 1080px;
  height: min(900px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.76) !important;
  border-radius: 28px !important;
  background: #f8fbff !important;
  box-shadow: 0 32px 90px rgb(15 23 42 / 0.28) !important;
}

#reporttpl-preview-modal .modal-header {
  flex: 0 0 auto;
  min-height: 86px;
  margin: 0;
  padding: 17px 22px 16px 24px;
  border-bottom: 1px solid var(--ai-line);
  background:
    radial-gradient(circle at 92% 0%, rgb(34 211 238 / 0.12), transparent 12rem),
    linear-gradient(135deg, #ffffff, #f4f9ff);
}

.reporttpl-preview-title-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.reporttpl-preview-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .09em;
  white-space: nowrap;
}

.reporttpl-preview-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ai-cyan);
  box-shadow: 0 0 0 5px rgb(34 211 238 / 0.11);
}

#reporttpl-preview-modal .modal-header h3 {
  margin: 0 0 4px;
  color: var(--ai-text);
  font-size: 19px;
  font-weight: 950;
  letter-spacing: -0.025em;
}

#reporttpl-preview-subtitle {
  max-width: 680px;
  margin: 0;
  overflow: hidden;
  color: var(--ai-sub);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#reporttpl-preview-modal .reporttpl-preview-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(47 125 255 / 0.12);
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  box-shadow: 0 8px 18px rgb(15 43 92 / 0.06);
  font-size: 21px;
}

#reporttpl-preview-modal .reporttpl-preview-close:hover {
  border-color: rgb(239 68 68 / 0.18);
  background: #fff1f2;
  color: #dc2626;
}

#reporttpl-preview-modal .reporttpl-preview-close:focus-visible {
  outline: 3px solid rgb(47 125 255 / 0.18);
  outline-offset: 2px;
}

#reporttpl-preview-modal .reporttpl-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  border-radius: 0;
  background:
    radial-gradient(circle at 10% 0%, rgb(47 125 255 / 0.08), transparent 20rem),
    linear-gradient(180deg, #f0f6fd, #f7f9fc);
  scrollbar-gutter: stable;
}

#reporttpl-preview-modal .reporttpl-preview-notice {
  max-width: 920px;
  min-height: 42px;
  margin: 0 auto 14px;
  padding: 9px 13px;
  border: 1px solid rgb(47 125 255 / 0.16);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.82);
  color: var(--ai-sub);
  box-shadow: 0 8px 22px rgb(15 43 92 / 0.04);
}

#reporttpl-preview-modal .reporttpl-preview-notice strong {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
}

#reporttpl-preview-modal .reporttpl-preview-paper {
  max-width: 920px;
  padding: 30px 32px 28px;
  border: 1px solid #dce6f2;
  border-radius: 12px;
  box-shadow: 0 20px 54px rgb(15 43 92 / 0.12);
}

#reporttpl-preview-modal .reporttpl-preview-head {
  gap: 6px;
  margin-bottom: 22px;
}

#reporttpl-preview-modal .reporttpl-preview-docno {
  color: var(--ai-blue);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

#reporttpl-preview-modal .reporttpl-preview-head strong {
  color: var(--ai-text);
  font-size: 23px;
  font-weight: 950;
  letter-spacing: -0.025em;
}

#reporttpl-preview-modal .reporttpl-preview-head small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ai-muted);
  font-weight: 700;
}

#reporttpl-preview-modal .reporttpl-preview-head small i {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #94a3b8;
}

#reporttpl-preview-modal .reporttpl-preview-fields {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-color: #dce6f2;
  border-radius: 10px;
  overflow: hidden;
}

#reporttpl-preview-modal .reporttpl-preview-fields div {
  flex: 1 1 25%;
  min-width: 180px;
  min-height: 60px;
  padding: 9px 11px;
  border-color: #dce6f2;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

#reporttpl-preview-modal .reporttpl-preview-fields span {
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 800;
}

#reporttpl-preview-modal .reporttpl-preview-fields em {
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 780;
}

#reporttpl-preview-modal .reporttpl-preview-section {
  margin-top: 18px;
}

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

#reporttpl-preview-modal .reporttpl-preview-section h4 {
  margin: 0;
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 950;
}

.reporttpl-preview-section-head > span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f0f6fd;
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 900;
}

.reporttpl-preview-table-wrap {
  overflow-x: auto;
  border: 1px solid #dce6f2;
  border-radius: 10px;
}

#reporttpl-preview-modal .reporttpl-preview-section table {
  min-width: 640px;
  border: 0;
}

#reporttpl-preview-modal .reporttpl-preview-section th,
#reporttpl-preview-modal .reporttpl-preview-section td {
  border: 0;
  border-right: 1px solid #dce6f2;
  border-bottom: 1px solid #dce6f2;
  padding: 8px 10px;
}

#reporttpl-preview-modal .reporttpl-preview-section th:last-child,
#reporttpl-preview-modal .reporttpl-preview-section td:last-child {
  border-right: 0;
}

#reporttpl-preview-modal .reporttpl-preview-section tbody tr:last-child td {
  border-bottom: 0;
}

#reporttpl-preview-modal .reporttpl-preview-section th {
  background: linear-gradient(180deg, #f5f9ff, #edf5ff);
  color: #52627a;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .025em;
}

#reporttpl-preview-modal .reporttpl-preview-section td {
  color: #334155;
}

.reporttpl-preview-measure {
  color: #94a3b8 !important;
  text-align: center !important;
}

.reporttpl-preview-result {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--ai-blue);
  font-size: 10px;
  font-weight: 900;
}

.reporttpl-preview-more {
  margin: 7px 2px 0;
  color: var(--ai-muted);
  font-size: 10px;
  text-align: right;
}

#reporttpl-preview-modal .reporttpl-preview-sign {
  padding-top: 18px;
  border-top: 1px dashed #dce6f2;
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
}

#reporttpl-preview-modal .reporttpl-preview-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 13px 24px;
  border-top: 1px solid var(--ai-line);
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 -10px 28px rgb(15 43 92 / 0.045);
}

#reporttpl-preview-modal .reporttpl-preview-actions p {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ai-muted);
  font-size: 11px;
}

#reporttpl-preview-modal .reporttpl-preview-actions p strong {
  color: var(--ai-blue);
  font-size: 11px;
  font-weight: 950;
}

.reporttpl-preview-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#reporttpl-preview-modal .reporttpl-preview-action-buttons .btn {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px !important;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 760px) {
  #reporttpl-preview-modal {
    padding: 10px;
  }

  #reporttpl-preview-modal .reporttpl-preview-modal {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 22px !important;
  }

  #reporttpl-preview-modal .modal-header {
    min-height: 74px;
    padding: 13px 14px 12px 16px;
  }

  .reporttpl-preview-kicker {
    display: none;
  }

  #reporttpl-preview-modal .reporttpl-preview-body {
    padding: 12px;
  }

  #reporttpl-preview-modal .reporttpl-preview-paper {
    padding: 22px 18px;
  }

  #reporttpl-preview-modal .reporttpl-preview-fields div {
    flex-basis: 50%;
    min-width: 145px;
  }

  #reporttpl-preview-modal .reporttpl-preview-actions {
    justify-content: flex-end;
    min-height: 62px;
    padding: 11px 14px;
  }

  #reporttpl-preview-modal .reporttpl-preview-actions p {
    display: none;
  }

  .reporttpl-preview-action-buttons {
    flex-wrap: wrap;
  }
}

/* ── KPI 筛选卡 · 全模块统一选中增强（圆点卡片 / 页级覆盖兜底）── */
.prod-kpi-button.is-active::after {
  box-shadow:
    0 0 0 4px rgb(255 255 255 / 0.88),
    0 0 16px color-mix(in srgb, var(--kpi-accent, #1677ff) 58%, transparent) !important;
}

#page-my-tasks .mytask-kpi.kpi-filter-btn.is-active::after {
  width: 12px;
  height: 12px;
  left: 29px;
  top: 33px;
}

:is(
  #page-msa .msa-kpi,
  #page-instruments .ins-kpi,
  #page-users-admin .ua-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-offline-import .offline-import-kpi,
  #page-order-flow .of-kpi,
  #page-mdm-product-categories .pcc-kpi,
  #page-mdm-params .mdmp-kpi
).kpi-filter-btn.is-active {
  border-color: var(--kpi-accent, #1677ff) !important;
}

.oqc-panel-focus,
.stats-kpi-focus {
  border-color: rgb(47 125 255 / 0.38) !important;
  box-shadow:
    0 0 0 4px rgb(47 125 255 / 0.14),
    0 18px 38px rgb(15 43 92 / 0.08) !important;
}

:is(
  #page-oqc-sn .oqc-kpi,
  #page-kanbans .kb-kpi,
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-flow-overview .fo-kpi,
  #page-flow-overview .fo-kpi-card,
  #page-templates .fc-ledger-kpi,
  .oqc-kpi,
  .kb-kpi,
  .stats-cpk-kpi,
  .stats-merge-kpi,
  .fo-kpi,
  .fo-kpi-card,
  .fc-ledger-kpi
).kpi-filter-btn.is-active::before {
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--kpi-accent, #1677ff) 42%, transparent),
    0 0 0 5px color-mix(in srgb, var(--kpi-accent, #1677ff) 20%, transparent) !important;
}

/* ── KPI 筛选卡 · 全站统一选中态（与「我的任务」附图一致）── */
button.fo-kpi-card.kpi-filter-btn,
button.fo-kpi.kpi-filter-btn {
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}

.fo-kpi-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fo-kpi-total { --fo-kpi-color: #1677ff; }
.fo-kpi-pass { --fo-kpi-color: #22c55e; }
.fo-kpi-fail { --fo-kpi-color: #ef4444; }
.fo-kpi-progress { --fo-kpi-color: #f59e0b; }
.fo-kpi-pending { --fo-kpi-color: #8b5cf6; }

.kpi-filter-btn:not(.kpi-stat-only):not(.prod-kpi) small {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.kpi-filter-btn:not(.is-active):not(.kpi-stat-only):not(.prod-kpi) small {
  background: rgb(248 251 255 / 0.9) !important;
  color: var(--ai-muted) !important;
  box-shadow: none !important;
}

.kpi-filter-btn.is-active:not(.prod-kpi) small {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 800 !important;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent) !important;
}

.kpi-filter-btn.is-active:not(.prod-kpi) small::after {
  content: none !important;
}

:is(
  .mytask-kpi,
  .completed-kpi,
  .tq-kpi,
  .mdmp-kpi,
  .ai-review-kpi,
  .sampling-kpi,
  .tagtpl-kpi,
  .pcc-kpi,
  .mdp-kpi,
  .mdm-status-kpi,
  .of-kpi,
  .fc-ledger-kpi,
  .ins-kpi,
  .msa-kpi,
  .crm-kpi,
  .ar-kpi,
  .offline-import-kpi,
  .ua-kpi,
  .oqc-kpi,
  .kb-kpi,
  .k3sync-card,
  .stats-cpk-kpi,
  .stats-merge-kpi,
  .fo-kpi,
  .fo-kpi-card
).kpi-filter-btn.is-active {
  border-color: var(--kpi-accent, #1677ff) !important;
  border-width: 2px !important;
  border-bottom-width: 4px !important;
  border-bottom-color: var(--kpi-accent, #1677ff) !important;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--kpi-accent, #1677ff) 22%, transparent),
    0 18px 38px color-mix(in srgb, var(--kpi-accent, #1677ff) 18%, transparent) !important;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--kpi-accent, #1677ff) 16%, transparent), transparent 8rem),
    linear-gradient(180deg, #fff, color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 90%, #fff)) !important;
  transform: translateY(-2px);
  z-index: 1;
}

:is(
  .mytask-kpi,
  .completed-kpi,
  .tq-kpi,
  .mdmp-kpi,
  .ai-review-kpi,
  .sampling-kpi,
  .tagtpl-kpi,
  .pcc-kpi,
  .mdp-kpi,
  .mdm-status-kpi,
  .of-kpi,
  .fc-ledger-kpi,
  .ins-kpi,
  .msa-kpi,
  .crm-kpi,
  .ar-kpi,
  .offline-import-kpi,
  .ua-kpi,
  .oqc-kpi,
  .kb-kpi,
  .k3sync-card,
  .stats-cpk-kpi,
  .stats-merge-kpi,
  .fo-kpi,
  .fo-kpi-card
).kpi-filter-btn.is-active strong {
  color: var(--kpi-accent, #1677ff) !important;
}

/* 金蝶同步中心 KPI：固定多行布局，避免选中态与圆点/说明文字互相遮挡 */
#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active {
  border-color: var(--kpi-accent, #1677ff) !important;
  border-width: 2px !important;
  border-bottom-width: 4px !important;
  border-bottom-color: var(--kpi-accent, #1677ff) !important;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--kpi-accent, #1677ff) 22%, transparent),
    0 18px 38px color-mix(in srgb, var(--kpi-accent, #1677ff) 18%, transparent) !important;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--kpi-accent, #1677ff) 16%, transparent), transparent 8rem),
    linear-gradient(180deg, #fff, color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 90%, #fff)) !important;
  transform: translateY(-2px);
  z-index: 1;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active::before {
  content: none !important;
  display: none !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active .k3sync-card-dot {
  box-shadow:
    0 0 0 4px rgb(255 255 255 / 0.88),
    0 0 16px color-mix(in srgb, var(--k3-kpi-color, var(--kpi-accent, #1677ff)) 58%, transparent);
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active > .k3sync-card-title {
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 900 !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn small {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  white-space: normal;
  min-height: 0;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn:not(.is-active) small {
  background: rgb(248 251 255 / 0.9) !important;
  color: var(--ai-muted) !important;
  box-shadow: none !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active small {
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 800 !important;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent) !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active small::after {
  content: none !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active strong {
  display: block !important;
  margin: 4px 0 !important;
  color: var(--kpi-accent, #1677ff) !important;
}

/* 供应商供货关系 · 对齐工序质检员表单布局 */
#page-supplier-products .itr-form,
#page-supplier-products .itr-table-wrap {
  border-color: var(--ai-line) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

#page-supplier-products .avl-filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--ai-line);
  background: linear-gradient(180deg, #fbfdff, #ffffff);
}

#page-supplier-products .avl-filter-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.7fr) auto;
  gap: 12px 14px;
  align-items: end;
  flex: 1 1 auto;
  min-width: 0;
}

#page-supplier-products .avl-filter-fields > label:not(.avl-check-row) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 800;
}

#page-supplier-products .avl-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

#page-supplier-products .avl-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px;
}

#page-supplier-products .avl-form-primary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

#page-supplier-products .avl-form label {
  color: var(--ai-muted);
  font-weight: 900;
}

#page-supplier-products .avl-form input:not([type='checkbox']),
#page-supplier-products .avl-form select,
#page-supplier-products .avl-filter-fields input:not([type='checkbox']),
#page-supplier-products .avl-filter-fields select {
  min-height: 42px;
  border-color: #aeb8c6 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #ffffff, #f8fbff) !important;
}

#page-supplier-products .avl-form input:not([type='checkbox']):focus,
#page-supplier-products .avl-form select:focus,
#page-supplier-products .avl-filter-fields input:not([type='checkbox']):focus,
#page-supplier-products .avl-filter-fields select:focus {
  border-color: rgb(47 125 255 / 0.42) !important;
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1), 0 10px 22px rgb(47 125 255 / 0.08) !important;
}

#page-supplier-products .avl-check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #aeb8c6;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #f8fbff);
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#page-supplier-products .avl-check-row input[type='checkbox'] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1677ff;
}

#page-supplier-products .avl-check-row span {
  line-height: 1.35;
}

#page-supplier-products .avl-filter-check {
  align-self: end;
}

#page-supplier-products .avl-outsourced-box {
  border-color: rgb(47 125 255 / 0.14) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 0% 0%, rgb(47 125 255 / 0.06), transparent 12rem),
    linear-gradient(180deg, #fbfdff, #f3f8ff) !important;
}

#page-supplier-products .avl-notes {
  margin: 0;
}

#page-supplier-products .avl-form-actions {
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid rgb(229 237 247 / 0.92);
}

@media (max-width: 1180px) {
  #page-supplier-products .avl-form-primary,
  #page-supplier-products .avl-outsourced-fields,
  #page-supplier-products .avl-filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #page-supplier-products .avl-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #page-supplier-products .avl-filter-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  #page-supplier-products .avl-form-primary,
  #page-supplier-products .avl-outsourced-fields,
  #page-supplier-products .avl-filter-fields {
    grid-template-columns: 1fr;
  }
}

/* 供方物料关系弹窗位于页面容器外，必须使用弹窗自身作为作用域。 */
#avl-edit-modal .crud-edit-modal-wide {
  width: min(520px, 94vw);
  max-width: min(520px, 94vw);
  overflow-x: hidden;
}

#avl-edit-modal .avl-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 0;
  min-width: 0;
}

#avl-edit-modal .avl-form-lead {
  display: none;
}

#avl-edit-modal .avl-form-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#avl-edit-modal .avl-form-section-title {
  display: none;
}

#avl-edit-modal .avl-form-primary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

#avl-edit-modal .avl-form-status-row {
  display: grid;
  grid-template-columns: minmax(120px, 140px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

#avl-edit-modal .avl-field-status {
  min-width: 0;
}

#avl-edit-modal .avl-outsourced-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: start;
}

#avl-edit-modal .avl-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

#avl-edit-modal .avl-form input:not([type='checkbox']),
#avl-edit-modal .avl-form select,
#avl-edit-modal .avl-form textarea {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
}

#avl-edit-modal .avl-form input:not([type='checkbox']):focus,
#avl-edit-modal .avl-form select:focus,
#avl-edit-modal .avl-form textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

#avl-edit-modal .avl-form textarea {
  min-height: 64px;
  max-height: 120px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
  line-height: 1.45;
}

/* 默认供方：横向开关，避免被 form label 的 column 盖掉 */
#avl-edit-modal .avl-form label.avl-preferred-toggle,
#avl-edit-modal .avl-preferred-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 500;
}

#avl-edit-modal .avl-preferred-toggle:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

#avl-edit-modal .avl-preferred-toggle:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
}

#avl-edit-modal .avl-preferred-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

#avl-edit-modal .avl-preferred-toggle__ui {
  flex: 0 0 auto;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.15s ease;
}

#avl-edit-modal .avl-preferred-toggle__ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.2);
  transition: transform 0.15s ease;
}

#avl-edit-modal .avl-preferred-toggle input:checked + .avl-preferred-toggle__ui {
  background: #2563eb;
}

#avl-edit-modal .avl-preferred-toggle input:checked + .avl-preferred-toggle__ui::after {
  transform: translateX(16px);
}

#avl-edit-modal .avl-preferred-toggle__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

#avl-edit-modal .avl-preferred-toggle__text strong {
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

#avl-edit-modal .avl-preferred-toggle__text small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
}

#avl-edit-modal .avl-check-row {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

#avl-edit-modal .avl-entity-combo {
  position: relative;
  display: grid;
  gap: 0;
}

#avl-edit-modal .avl-entity-combo.is-selected .avl-entity-combo__control {
  display: none;
}

#avl-edit-modal .avl-entity-combo__control {
  position: relative;
}

#avl-edit-modal .avl-entity-combo__control .avl-entity-combo__input {
  padding-right: 32px;
}

#avl-edit-modal .avl-entity-combo__affordance {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}

#avl-edit-modal .avl-entity-combo.is-open .avl-entity-combo__affordance {
  color: #2563eb;
}

#avl-edit-modal .avl-entity-combo__list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.16);
}

#avl-edit-modal .avl-entity-combo__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}

#avl-edit-modal .avl-entity-combo__item:hover,
#avl-edit-modal .avl-entity-combo__item.is-active {
  background: #eff6ff;
}

#avl-edit-modal .avl-entity-combo__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#avl-edit-modal .avl-entity-combo__item-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
}

#avl-edit-modal .avl-entity-combo__item-name {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

#avl-edit-modal .avl-entity-combo__item-meta,
#avl-edit-modal .avl-entity-combo__empty {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

#avl-edit-modal .avl-entity-combo__empty {
  padding: 14px 10px;
  text-align: center;
}

#avl-edit-modal .avl-credit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#avl-edit-modal .avl-credit-pill--gold {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

#avl-edit-modal .avl-credit-pill--watch {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

#avl-edit-modal .avl-credit-pill--red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

#avl-edit-modal .avl-credit-pill--normal {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

#avl-edit-modal .avl-selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

#avl-edit-modal .avl-selected-card.hidden {
  display: none;
}

#avl-edit-modal .avl-selected-card__body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

#avl-edit-modal .avl-selected-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

#avl-edit-modal .avl-selected-card__title strong {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

#avl-edit-modal .avl-selected-card__name {
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

#avl-edit-modal .avl-selected-card__meta {
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#avl-edit-modal .avl-selected-card__clear {
  flex-shrink: 0;
  color: #2563eb;
  font-weight: 600;
}

#avl-edit-modal .avl-selected-summary {
  display: none;
}

#avl-edit-modal .avl-outsource-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
  border-top: 1px dashed #e2e8f0;
}

#avl-edit-modal .avl-outsource-block.hidden {
  display: none;
}

#avl-edit-modal .avl-outsource-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

#avl-edit-modal .avl-outsource-toggle span:first-child {
  color: #475569;
}

#avl-edit-modal .avl-outsource-toggle small {
  color: #94a3b8;
  font-weight: 400;
}

#avl-edit-modal .avl-outsource-chevron {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}

#avl-edit-modal .avl-outsource-toggle[aria-expanded='true'] .avl-outsource-chevron {
  transform: rotate(180deg);
}

#avl-edit-modal .avl-outsource-toggle.is-recommended span:first-child {
  color: #334155;
}

#avl-edit-modal .avl-outsource-toggle.is-recommended small {
  color: #94a3b8;
}

#avl-edit-modal .avl-outsourced-box {
  padding: 12px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #f8fafc;
}

#avl-edit-modal .avl-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#avl-edit-modal .avl-notes textarea {
  min-height: 38px;
}

#avl-edit-modal .avl-form-actions {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

@media (max-width: 680px) {
  #avl-edit-modal .avl-outsourced-fields {
    grid-template-columns: 1fr;
  }

  #avl-edit-modal .avl-form-status-row {
    grid-template-columns: 1fr;
  }
}

/* 偏移修复：选中卡与纯统计卡也必须具备完整 KPI 卡片盒模型。 */
#page-kanbans .kb-kpi {
  position: relative;
  min-height: 108px;
  box-sizing: border-box;
  padding: 16px 16px 14px 58px;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
  text-align: left;
}

/* 指定模块页头统一为「我的任务调度台」视觉语言。 */
body.layout-pro :is(#page-dashboard, section.page) .task-command-hero {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 22px !important;
  width: 100%;
  min-height: 138px !important;
  box-sizing: border-box;
  margin: 0 0 14px !important;
  padding: 24px !important;
  border: 1px solid var(--ai-line, #e6edf5) !important;
  border-radius: 28px !important;
  background: linear-gradient(135deg, #fff, #f7fbff) !important;
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05) !important;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero::before {
  content: none !important;
  display: none !important;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero::after {
  content: '' !important;
  position: absolute !important;
  z-index: -1;
  top: 50% !important;
  right: 18px !important;
  bottom: auto !important;
  left: auto !important;
  width: 166px !important;
  height: 166px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgb(47 125 255 / 0.08) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: translateY(-50%) !important;
  pointer-events: none;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero h1,
body.layout-pro :is(#page-dashboard, section.page) .task-command-hero h2 {
  margin: 8px 0 0 !important;
  color: var(--ai-text, #172033) !important;
  font-size: 24px !important;
  font-weight: 950 !important;
  line-height: 1.22 !important;
  letter-spacing: -0.03em !important;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero h1 + p,
body.layout-pro :is(#page-dashboard, section.page) .task-command-hero h2 + p,
body.layout-pro :is(#page-dashboard, section.page) .task-command-hero [class*='lead'] {
  max-width: 780px;
  margin: 8px 0 0 !important;
  color: var(--ai-sub, #64748b) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ai-blue, #1677ff);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero-kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ai-blue, #1677ff);
  box-shadow: 0 0 0 4px rgb(47 125 255 / 0.1);
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero :is(
  p[class*='eyebrow'],
  p[class*='hero-badge'],
  span[class*='section-kicker']:not(.task-command-hero-kicker),
  [class*='hero-tags'],
  [class*='-hero-icon']
) {
  display: none !important;
}

body.layout-pro :is(#page-dashboard, section.page) .task-command-hero :is(
  [class*='hero-actions'],
  [class*='hero-panel'],
  [class*='head-actions']
) {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* 检验单台账 hero 仅含文案，KPI 已独立成行 */
body.layout-pro #page-templates .fc-ledger-hero.task-command-hero {
  display: block !important;
  min-height: 0 !important;
}

body.layout-pro #page-templates .fc-ledger-hero.task-command-hero::after {
  content: '' !important;
  position: absolute !important;
  z-index: 0;
  top: auto !important;
  right: 28px !important;
  bottom: -48px !important;
  left: auto !important;
  width: 190px !important;
  height: 190px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgb(47 125 255 / 0.055) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: none;
}

body.layout-pro #page-templates .fc-ledger-hero.task-command-hero h2 {
  margin: 4px 0 8px !important;
  font-size: 28px !important;
  letter-spacing: -0.04em !important;
}

body.layout-pro #page-templates .task-command-hero .fc-ledger-hero-tags {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  body.layout-pro :is(#page-dashboard, section.page) .task-command-hero {
    align-items: flex-start !important;
    flex-direction: column !important;
    min-height: 0 !important;
    padding: 20px !important;
  }

  body.layout-pro :is(#page-dashboard, section.page) .task-command-hero :is(
    [class*='hero-actions'],
    [class*='hero-panel'],
    [class*='head-actions']
  ) {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ══ KPI 卡片 · 遗留分析/仪器/系统页统一（对齐「我的任务」色块+圆点） ══ */

.stats-cpk-kpi { --kpi-accent: var(--cpk-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--cpk-kpi-color, #1677ff) 12%, #eef6ff); }
.stats-merge-kpi { --kpi-accent: var(--merge-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--merge-kpi-color, #1677ff) 12%, #eef6ff); }
.ins-kpi { --kpi-accent: var(--ins-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--ins-kpi-color, #1677ff) 12%, #eef6ff); }
.msa-kpi { --kpi-accent: var(--msa-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--msa-kpi-color, #1677ff) 12%, #eef6ff); }
.crm-kpi { --kpi-accent: var(--crm-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--crm-kpi-color, #1677ff) 12%, #eef6ff); }
.ar-kpi { --kpi-accent: var(--ar-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--ar-kpi-color, #1677ff) 12%, #eef6ff); }
.kb-kpi { --kpi-accent: var(--kb-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--kb-kpi-color, #1677ff) 12%, #eef6ff); }
.offline-import-kpi { --kpi-accent: var(--offline-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--offline-kpi-color, #1677ff) 12%, #eef6ff); }
.ua-kpi { --kpi-accent: var(--ua-kpi-color, #1677ff); --kpi-accent-bg: color-mix(in srgb, var(--ua-kpi-color, #1677ff) 12%, #eef6ff); }

:is(
  #page-stats-cpk .stats-cpk-kpi-grid,
  #page-stats-merge .stats-merge-kpi-grid,
  #page-instruments .ins-kpi-grid,
  #page-msa .msa-kpi-grid,
  #page-cal-reminders .crm-kpi-grid,
  #page-auto-rules .ar-kpi-grid,
  #page-kanbans .kb-kpi-grid,
  #page-offline-import .offline-import-kpi-grid,
  #page-users-admin .ua-kpi-grid
) {
  display: grid !important;
  width: 100% !important;
  gap: 12px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

button:is(
  .stats-cpk-kpi,
  .stats-merge-kpi,
  .ins-kpi,
  .msa-kpi,
  .crm-kpi,
  .ar-kpi,
  .kb-kpi,
  .offline-import-kpi,
  .ua-kpi
).kpi-filter-btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
) {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 20px 18px 16px 68px !important;
  border: 1px solid var(--ai-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgb(34 211 238 / 0.08), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 32px rgb(15 43 92 / 0.05);
  box-sizing: border-box;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
)::before {
  content: '' !important;
  position: absolute;
  left: 18px !important;
  top: 22px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, var(--kpi-accent-bg, #eef6ff), #ffffff) !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1) !important;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
)::after {
  content: '' !important;
  position: absolute;
  left: 30px;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--kpi-accent, #1677ff);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72);
  pointer-events: none;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
).kpi-filter-btn.is-active::before {
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--kpi-accent, #1677ff) 42%, transparent),
    0 0 0 5px color-mix(in srgb, var(--kpi-accent, #1677ff) 20%, transparent) !important;
  background: linear-gradient(135deg, var(--kpi-accent-bg, #eef6ff), #ffffff) !important;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
).kpi-filter-btn.is-active::after {
  box-shadow:
    0 0 0 5px rgb(255 255 255 / 0.78),
    0 0 18px color-mix(in srgb, var(--kpi-accent, #1677ff), transparent 55%) !important;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
) span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
) strong {
  display: block;
  margin: 10px 0 6px;
  color: #172033;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
) small {
  display: inline-flex !important;
  align-items: center;
  width: fit-content !important;
  max-width: 100%;
  margin-top: 2px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  background: rgb(248 251 255 / 0.9) !important;
  color: var(--ai-muted) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
).kpi-filter-btn.is-active strong {
  color: var(--kpi-accent, #1677ff) !important;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
).kpi-filter-btn.is-active small {
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 800 !important;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent) !important;
}

:is(
  #page-stats-cpk .stats-cpk-kpi,
  #page-stats-merge .stats-merge-kpi,
  #page-instruments .ins-kpi,
  #page-msa .msa-kpi,
  #page-cal-reminders .crm-kpi,
  #page-auto-rules .ar-kpi,
  #page-kanbans .kb-kpi,
  #page-offline-import .offline-import-kpi,
  #page-users-admin .ua-kpi
).kpi-filter-btn.is-active small::after {
  content: none !important;
}

@media (max-width: 960px) {
  :is(
    #page-stats-cpk .stats-cpk-kpi-grid,
    #page-stats-merge .stats-merge-kpi-grid,
    #page-instruments .ins-kpi-grid,
    #page-msa .msa-kpi-grid,
    #page-cal-reminders .crm-kpi-grid,
    #page-auto-rules .ar-kpi-grid,
    #page-kanbans .kb-kpi-grid,
    #page-offline-import .offline-import-kpi-grid,
    #page-users-admin .ua-kpi-grid
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  :is(
    #page-stats-cpk .stats-cpk-kpi-grid,
    #page-stats-merge .stats-merge-kpi-grid,
    #page-instruments .ins-kpi-grid,
    #page-msa .msa-kpi-grid,
    #page-cal-reminders .crm-kpi-grid,
    #page-auto-rules .ar-kpi-grid,
    #page-kanbans .kb-kpi-grid,
    #page-offline-import .offline-import-kpi-grid,
    #page-users-admin .ua-kpi-grid
  ) {
    grid-template-columns: 1fr !important;
  }
}

/* 金蝶同步中心 · KPI 卡片图标对齐 */
#page-kingdee-sync .k3sync-grid {
  width: 100% !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn {
  overflow: hidden;
  min-height: 124px !important;
  padding: 20px 18px 16px 68px !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn::before {
  content: '' !important;
  display: block !important;
  position: absolute;
  left: 18px !important;
  top: 22px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, var(--kpi-accent-bg, #eef6ff), #ffffff) !important;
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.1) !important;
}

#page-kingdee-sync .k3sync-card-dot {
  left: 30px !important;
  top: 34px !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  background: var(--k3-kpi-color, var(--kpi-accent, #1677ff)) !important;
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.72) !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active::before {
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--kpi-accent, #1677ff) 42%, transparent),
    0 0 0 5px color-mix(in srgb, var(--kpi-accent, #1677ff) 20%, transparent) !important;
  background: linear-gradient(135deg, var(--kpi-accent-bg, #eef6ff), #ffffff) !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn.is-active .k3sync-card-dot {
  box-shadow:
    0 0 0 5px rgb(255 255 255 / 0.78),
    0 0 18px color-mix(in srgb, var(--k3-kpi-color, var(--kpi-accent, #1677ff)), transparent 55%) !important;
}

#page-kingdee-sync .k3sync-card.kpi-filter-btn strong {
  margin: 10px 0 6px !important;
}

@media (max-width: 960px) {
  #page-kingdee-sync .k3sync-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  #page-kingdee-sync .k3sync-grid {
    grid-template-columns: 1fr !important;
  }
}

/* MSA · 底部说明 pill 与全站 KPI 对齐（覆盖页内遗留 flat 样式） */
#page-msa .msa-kpi.kpi-filter-btn small,
#page-msa .msa-kpi.kpi-filter-btn.is-active small {
  display: inline-flex !important;
  align-items: center !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin-top: 2px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}

#page-msa .msa-kpi.kpi-filter-btn:not(.is-active) small {
  background: rgb(248 251 255 / 0.9) !important;
  color: var(--ai-muted) !important;
  box-shadow: none !important;
}

#page-msa .msa-kpi.kpi-filter-btn.is-active small {
  color: var(--kpi-accent, #1677ff) !important;
  font-weight: 800 !important;
  background: color-mix(in srgb, var(--kpi-accent-bg, #eef6ff) 94%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-accent, #1677ff) 24%, transparent) !important;
}

#page-msa .msa-kpi.kpi-filter-btn.is-active small::after {
  content: none !important;
}

/* ========== QCOS 全局工具栏 · 导航与操作解耦 ========== */
#sidebar-footer {
  display: none !important;
}

.qcos-global-header {
  position: relative;
  z-index: 120;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  padding: 8px 16px;
  box-sizing: border-box;
  border-bottom: 1px solid #e7edf5;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 1px 0 rgb(15 43 92 / 0.02);
  backdrop-filter: blur(14px);
}

.qcos-global-context {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #24364d;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.qcos-global-context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1677ff;
  box-shadow: 0 0 0 4px rgb(22 119 255 / 0.1);
}

.qcos-global-actions,
#qcos-global-tools-slot,
#qcos-global-tools-slot .sidebar-tools-icons {
  display: flex !important;
  align-items: center;
  gap: 7px !important;
}

.qcos-global-actions {
  justify-content: flex-end;
  min-width: 0;
}

#qcos-global-scan-slot .sidebar-tools-scan {
  display: grid !important;
  grid-template-columns: minmax(180px, 260px) auto;
  align-items: center;
  gap: 7px;
  width: auto;
}

#qcos-global-scan-slot .qcos-field-clear-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

#qcos-global-scan-slot .global-scan {
  width: 100% !important;
  height: 34px !important;
  padding: 0 30px 0 12px !important;
  border: 1px solid #d9e3f0 !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-size: 12px !important;
  color: #26384f !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

#qcos-global-scan-slot .qcos-field-clear {
  right: 8px;
  z-index: 5;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
}

#qcos-global-scan-slot .qcos-field-clear:hover {
  background: rgb(100 116 139 / 0.14);
  color: #334155;
}

#qcos-global-scan-slot .global-scan:focus {
  border-color: #7db1ff !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgb(22 119 255 / 0.1) !important;
}

#qcos-global-scan-slot .sidebar-scan-btn {
  width: auto !important;
  min-width: 54px;
  height: 34px;
  min-height: 34px;
  padding: 0 12px !important;
  border: 1px solid #1677ff !important;
  border-radius: 9px !important;
  background: #1677ff !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

#qcos-global-tools-slot .sidebar-tool-btn,
#qcos-global-tools-slot .erp-refresh-btn {
  position: relative;
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #63758d !important;
  cursor: pointer;
}

#qcos-global-tools-slot .sidebar-tool-btn:hover,
#qcos-global-tools-slot .erp-refresh-btn:hover {
  border-color: #d8e7fb !important;
  background: #f1f6fd !important;
  color: #1677ff !important;
}

#qcos-global-tools-slot .sidebar-notify-wrap {
  position: relative;
}

#qcos-global-tools-slot .notify-panel {
  top: calc(100% + 10px) !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 260 !important;
}

.qcos-user-menu {
  position: relative;
  margin-left: 2px;
  padding-left: 9px;
  border-left: 1px solid #e7edf5;
}

.qcos-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 9px 3px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #27394f;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

.qcos-user-trigger:hover,
.qcos-user-trigger[aria-expanded="true"] {
  border-color: #d8e7fb;
  background: #f3f7fd;
}

#qcos-user-trigger-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qcos-user-trigger .sidebar-profile-avatar {
  display: grid !important;
  place-items: center;
  width: 28px !important;
  height: 28px !important;
  border-radius: 9px !important;
  background: linear-gradient(135deg, #1677ff, #14b8d4) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  box-shadow: 0 5px 12px rgb(22 119 255 / 0.18) !important;
}

.qcos-user-trigger .sidebar-profile-name {
  display: block !important;
  max-width: 110px;
  overflow: hidden;
  color: #27394f !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qcos-user-chevron {
  width: 6px;
  height: 6px;
  margin: 0 1px 3px 2px;
  border-right: 1.5px solid #8190a5;
  border-bottom: 1.5px solid #8190a5;
  transform: rotate(45deg);
}

.qcos-user-trigger[aria-expanded="true"] .qcos-user-chevron {
  margin-top: 4px;
  transform: rotate(225deg);
}

.qcos-user-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 260;
  width: 286px;
  padding: 14px;
  box-sizing: border-box;
  border: 1px solid #dce6f3;
  border-radius: 13px;
  background: rgb(255 255 255 / 0.99);
  box-shadow: 0 20px 50px rgb(18 45 78 / 0.18), 0 4px 12px rgb(18 45 78 / 0.07);
}

#qcos-user-summary-slot {
  padding: 3px 2px 12px;
  border-bottom: 1px solid #edf1f6;
}

#qcos-user-summary-slot .sidebar-profile-account {
  display: block;
  color: #62748b !important;
  font-size: 12px !important;
  line-height: 1.5;
}

#qcos-user-auth-slot .sidebar-auth-panel {
  display: grid !important;
  gap: 8px;
  margin: 12px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#qcos-user-auth-slot .user-label {
  color: #718197 !important;
  font-size: 11px;
  font-weight: 700;
}

#qcos-user-auth-slot #current-user {
  width: 100%;
  height: 36px;
  border: 1px solid #dce5f1;
  border-radius: 9px;
  background: #f8fafc;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#qcos-user-auth-slot .sidebar-auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#page-entry .entry-hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

#page-entry .entry-caliper-btn,
#page-entry .sidebar-caliper-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px !important;
  border: 1px solid #cfe0f6 !important;
  border-radius: 9px !important;
  background: rgb(255 255 255 / 0.84) !important;
  color: #435972 !important;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#page-entry .entry-caliper-btn:hover,
#page-entry .sidebar-caliper-btn:hover {
  border-color: #8cbaff !important;
  background: #fff !important;
  color: #1677ff !important;
}

@media (max-width: 900px) {
  .qcos-global-header {
    align-items: flex-start;
    min-height: 88px;
    padding: 8px 12px;
  }

  .qcos-global-context {
    display: none;
  }

  .qcos-global-actions {
    flex: 1;
    flex-wrap: wrap;
    width: 100%;
  }

  #qcos-global-scan-slot {
    order: 3;
    width: 100%;
  }

  #qcos-global-scan-slot .sidebar-tools-scan {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  #qcos-global-scan-slot .global-scan {
    width: 100% !important;
  }

  #qcos-global-tools-slot {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  #qcos-global-tools-slot .sidebar-tool-btn[title="打印"],
  #qcos-global-tools-slot .sidebar-tool-btn[title="帮助"] {
    display: none !important;
  }

  .qcos-user-trigger .sidebar-profile-name {
    display: none !important;
  }

  .qcos-user-panel {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  #page-entry .entry-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ========== 页面内双侧栏治理 · 列表优先 ========== */
body:not(.prod-master-detail-open) #page-products .prod-archive-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
}

body:not(.prod-master-detail-open) #page-products .prod-archive-body {
  grid-column: 1 !important;
  width: 100% !important;
  min-width: 0;
}

#page-products .prod-filter-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -2px -2px 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e8eef6;
}

#page-products .prod-filter-drawer-head > div {
  display: grid;
  gap: 3px;
}

#page-products .prod-filter-drawer-head strong {
  color: #17263b;
  font-size: 16px;
  font-weight: 800;
}

#page-products .prod-filter-drawer-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #dfe7f2;
  border-radius: 9px;
  background: #fff;
  color: #718197;
  font: 400 20px/1 Inter, sans-serif;
  cursor: pointer;
}

#page-products .prod-filter-drawer-close:hover {
  border-color: #9fc4fb;
  background: #f0f6ff;
  color: #1677ff;
}

body:not(.prod-master-detail-open) #page-products .prod-archive-aside {
  position: fixed !important;
  z-index: 360 !important;
  top: 68px !important;
  right: 14px !important;
  bottom: 14px !important;
  left: auto !important;
  grid-column: auto !important;
  width: min(380px, calc(100vw - 28px)) !important;
  max-height: none !important;
  padding: 16px !important;
  overflow-y: auto !important;
  border: 1px solid #dce6f3 !important;
  border-radius: 16px !important;
  background: rgb(255 255 255 / 0.99) !important;
  box-shadow: -12px 0 32px rgb(15 43 92 / 0.10) !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

body:not(.prod-master-detail-open) #page-products .prod-archive-aside.is-drawer-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

#page-products .prod-filter-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 350;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: default;
  transition: opacity .18s ease, visibility .18s ease;
}

body.prod-filter-drawer-open #page-products:not(.hidden) .prod-filter-backdrop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#page-products .prod-advanced-filter-btn {
  border-color: #bcd5f7 !important;
  background: #f2f7ff !important;
  color: #1768d7 !important;
}

#page-products .prod-advanced-filter-btn::before {
  content: '';
  width: 12px;
  height: 12px;
  margin-right: 5px;
  background: linear-gradient(180deg, transparent 0 18%, currentColor 18% 28%, transparent 28% 48%, currentColor 48% 58%, transparent 58% 78%, currentColor 78% 88%, transparent 88%);
  opacity: .72;
}

/* 检验项目库：分类由纵向侧栏改为横向分类条 */
#page-mdm-params .mdmp-workspace {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}

#page-mdm-params .mdmp-category-side {
  width: 100% !important;
  padding: 12px 14px !important;
  overflow: visible !important;
}

#page-mdm-params .mdmp-category-side .mdmp-panel-head {
  align-items: center;
  margin-bottom: 10px;
  padding: 0 0 10px !important;
  border-bottom: 1px solid #edf2f7;
  background: transparent;
}

#page-mdm-params .mdmp-category-side .mdmp-panel-head p {
  display: none;
}

#page-mdm-params .mdmp-category-nav {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  align-content: flex-start;
  gap: 10px !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: visible !important;
}

#page-mdm-params .mdmp-cat-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 0 1 auto;
  gap: 6px;
  margin: 0 !important;
  padding: 8px 10px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #f9fafb;
}

#page-mdm-params .mdmp-cat-group-title {
  flex: 0 0 auto;
  margin: 0 !important;
  color: #6b7280 !important;
  font-size: 11px !important;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

#page-mdm-params .mdmp-cat-group-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

#page-mdm-params .mdmp-cat-item {
  display: inline-flex !important;
  width: auto !important;
  margin-top: 0 !important;
  min-height: 32px;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  white-space: nowrap;
}

/* 检验单台账：模板树收敛为横向阶段快捷筛选 */
#page-templates .fc-layout {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

#page-templates .fc-tree {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100% !important;
  min-width: 0;
  padding: 10px 12px !important;
  overflow-x: auto;
  overflow-y: hidden;
}

#page-templates .fc-tree-title {
  flex: 0 0 auto;
  margin: 0 6px 0 0 !important;
  white-space: nowrap;
}

#page-templates #fc-tree-groups {
  display: flex;
  align-items: center;
  gap: 7px;
}

#page-templates .fc-tree-group {
  flex: 0 0 auto;
  margin: 0 !important;
}

#page-templates .fc-tree-node {
  width: auto !important;
  min-height: 34px;
  margin: 0 !important;
  padding: 7px 11px !important;
  border-radius: 9px !important;
  white-space: nowrap;
}

#page-templates .fc-tree-node:hover {
  transform: none !important;
}

#page-templates .fc-tree-line-wrap {
  display: none !important;
}

#page-templates .fc-tree-node-active {
  box-shadow: inset 0 0 0 1px rgb(47 125 255 / 0.2) !important;
}

/* 测量仪器台账：仪器类型改为横向筛选条 */
#page-instruments .ins-workspace {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}

#page-instruments .ins-sidebar {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100% !important;
  min-width: 0;
  padding: 10px 12px !important;
  overflow: hidden;
}

#page-instruments .ins-sidebar-title {
  flex: 0 0 auto;
  margin: 0 8px 0 0 !important;
  white-space: nowrap;
}

#page-instruments #ins-cat-all {
  flex: 0 0 auto;
  width: auto !important;
  margin: 0 !important;
}

#page-instruments .ins-cat-list {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: row !important;
  align-items: center;
  gap: 7px !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

#page-instruments .ins-cat-btn {
  flex: 0 0 auto;
  width: auto !important;
  min-height: 34px;
  padding: 7px 11px !important;
  white-space: nowrap;
}

@media (max-width: 900px) {
  body:not(.prod-master-detail-open) #page-products .prod-archive-aside {
    top: auto !important;
    right: 10px !important;
    bottom: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-height: min(76vh, 680px) !important;
    box-shadow: 0 -16px 44px rgb(15 43 92 / 0.18) !important;
    transform: translateY(20px);
  }

  body:not(.prod-master-detail-open) #page-products .prod-archive-aside.is-drawer-open {
    transform: translateY(0);
  }

  #page-products .prod-filter-backdrop {
    display: block;
    background: rgb(15 28 48 / 0.22);
  }

  body.prod-filter-drawer-open #page-products:not(.hidden) .prod-filter-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.prod-filter-drawer-open {
    overflow: hidden;
  }

  #page-mdm-params .mdmp-category-side .mdmp-panel-head p {
    display: none;
  }
}

/* ========== 物料低频工具 · 菜单、快速建档弹窗与 AI 设置抽屉 ========== */
#page-products .prod-more-tools {
  display: none !important;
}

#page-products .prod-utility-menu {
  position: relative;
  z-index: 40;
}

#page-products .prod-utility-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
}

#page-products .prod-utility-menu > summary::-webkit-details-marker {
  display: none;
}

#page-products .prod-utility-menu > summary::after {
  content: '';
  width: 6px;
  height: 6px;
  margin: 0 1px 3px 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

#page-products .prod-utility-menu[open] > summary::after {
  margin-top: 4px;
  transform: rotate(225deg);
}

#page-products .prod-utility-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: grid;
  gap: 4px;
  width: 260px;
  padding: 7px;
  border: 1px solid #dfe7f2;
  border-radius: 11px;
  background: rgb(255 255 255 / 0.99);
  box-shadow: 0 14px 34px rgb(15 43 92 / 0.15);
}

#page-products .prod-utility-menu-panel button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #26384f;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left;
  cursor: pointer;
}

#page-products .prod-utility-menu-panel button:hover {
  background: #f0f6ff;
  color: #1677ff;
}

#page-products .prod-utility-menu-panel strong {
  font-size: 13px;
  font-weight: 750;
}

#page-products .prod-utility-menu-panel small {
  color: #7a899d;
  font-size: 11px;
}

#page-products .prod-ai-config-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid #dfe8f4;
  border-radius: 11px;
  background: linear-gradient(90deg, #fff, #f7faff);
}

#page-products .prod-ai-config-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 5px rgb(22 163 74 / 0.09);
}

#page-products .prod-ai-config-summary > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

#page-products .prod-ai-config-summary strong {
  flex: 0 0 auto;
  color: #25384f;
  font-size: 12px;
  font-weight: 800;
}

#page-products .prod-ai-config-summary small {
  overflow: hidden;
  color: #687a91;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-utility-overlay {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.prod-utility-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  background: rgb(15 28 48 / 0.12);
  cursor: default;
}

.prod-quick-modal-panel,
.prod-ai-drawer-panel {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  border: 1px solid #dce6f3;
  background: rgb(255 255 255 / 0.99);
}

.prod-quick-modal-panel {
  width: min(560px, calc(100vw - 32px));
  max-height: min(82vh, 680px);
  padding: 18px;
  overflow-y: auto;
  border-radius: 15px;
  box-shadow: 0 24px 64px rgb(15 43 92 / 0.18);
}

.prod-ai-drawer-shell {
  place-items: stretch end;
  padding: 14px;
}

.prod-ai-drawer-panel {
  width: min(420px, calc(100vw - 28px));
  height: 100%;
  padding: 18px;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: -12px 0 36px rgb(15 43 92 / 0.13);
}

.prod-utility-surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e9eef5;
}

.prod-utility-surface-head > div {
  display: grid;
  gap: 3px;
}

.prod-utility-surface-head span {
  color: #1677ff;
  font: 750 10px/1.4 Inter, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.prod-utility-surface-head h3 {
  margin: 0;
  color: #17263b;
  font-size: 18px;
  font-weight: 800;
}

.prod-utility-surface-head p {
  margin: 0;
  color: #75859a;
  font-size: 12px;
}

.prod-utility-surface-head > button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #dfe7f2;
  border-radius: 9px;
  background: #fff;
  color: #718197;
  font: 400 20px/1 Inter, sans-serif;
  cursor: pointer;
}

.prod-utility-surface-head > button:hover {
  border-color: #9fc4fb;
  background: #f0f6ff;
  color: #1677ff;
}

.prod-quick-modal-panel .prod-quick-add {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.prod-quick-modal-panel .prod-more-section-head {
  display: none;
}

.prod-quick-modal-panel .prod-quick-add-fields {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  width: 100% !important;
  grid-column: 1 / -1 !important;
}

.prod-quick-modal-panel .prod-quick-add-fields input,
.prod-quick-modal-panel .prod-quick-add-fields select,
.prod-quick-modal-panel .prod-quick-extra-fields input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #dce5f1;
  border-radius: 9px;
  background: #fff;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.prod-quick-modal-panel .prod-quick-extra-fields {
  display: grid;
  gap: 10px;
  width: 100%;
}

.prod-quick-modal-panel .prod-quick-deferred-hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.prod-quick-modal-panel .prod-quick-add-fields button {
  min-height: 38px;
  border-color: #1677ff !important;
  background: #1677ff !important;
  color: #fff !important;
  font-weight: 750;
}

.prod-ai-drawer-panel .prod-ai-settings {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.prod-ai-drawer-panel .prod-ai-settings-summary {
  display: none !important;
}

.prod-ai-drawer-panel .prod-ai-settings-body {
  display: grid !important;
  gap: 16px;
  padding: 0 !important;
}

.prod-ai-drawer-panel .prod-ai-settings-toggle {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  padding: 12px;
  border: 1px solid #dfe8f4;
  border-radius: 11px;
  background: #f7faff;
}

.prod-ai-drawer-panel .prod-ai-settings-toggle input {
  grid-row: 1 / 3;
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
}

.prod-ai-drawer-panel .prod-ai-settings-toggle span {
  color: #26384f;
  font-size: 13px;
  font-weight: 750;
}

.prod-ai-drawer-panel .prod-ai-settings-toggle small {
  color: #728198;
  font-size: 11px;
  line-height: 1.55;
}

.prod-ai-drawer-panel .prod-ai-settings-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 13px !important;
}

.prod-ai-drawer-panel .prod-ai-settings-grid label {
  display: grid;
  gap: 6px;
  color: #40546d;
  font-size: 12px;
  font-weight: 750;
}

.prod-ai-drawer-panel .prod-ai-settings-grid select,
.prod-ai-drawer-panel .prod-ai-settings-grid input[type='text'] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dce5f1;
  border-radius: 9px;
  background: #fff;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.prod-ai-drawer-panel .prod-ai-settings-foot {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e9eef5;
}

.prod-ai-drawer-panel #prod-ai-settings-save {
  border-color: #1677ff !important;
  background: #1677ff !important;
  color: #fff !important;
  font-weight: 750;
}

body.prod-utility-surface-open .app-main {
  overflow: hidden !important;
}

/* 图纸识别审核 · 总览 / 队列 / 抽屉向导 */
#page-ai-review .ai-review-overview-bar {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--ai-line, #e2ebf7);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(15 43 92 / 0.1);
}

.ai-review-overview-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 11px;
  background: #f5f9ff;
  color: var(--ai-text, #172033);
  cursor: pointer;
}

.ai-review-overview-toggle > span:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.ai-review-overview-toggle strong { font-size: 12px; }
.ai-review-overview-toggle small { color: var(--ai-muted, #718096); font-size: 10px; }
.ai-review-overview-chevron { transition: transform .2s ease; }
.ai-review-overview-bar:not(.is-collapsed) .ai-review-overview-chevron { transform: rotate(180deg); }

#page-ai-review .ai-review-overview-bar.is-collapsed {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

#page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 6px;
}

#page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px !important;
  padding: 6px 10px !important;
  border-radius: 11px !important;
  box-shadow: none !important;
}

#page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi::before,
#page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi::after,
#page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi small {
  display: none;
}

#page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi span {
  color: var(--ai-sub, #46566f);
  font-size: 11px;
}

#page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi strong {
  color: var(--ai-text, #172033);
  font-size: 17px !important;
  line-height: 1;
}

body.ai-review-detail-open { overflow: hidden; }

.ai-draft-detail-shell {
  position: fixed;
  inset: auto;
  left: 240px;
  right: 0;
  top: 56px;
  bottom: 0;
  z-index: 2147483000;
  display: grid;
  justify-items: end;
}

.ai-draft-detail-shell.hidden { display: none !important; }

.ai-draft-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 0.11);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#page-ai-review .ai-draft-detail-shell .ai-draft-detail-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 240px));
  height: calc(100vh - 56px);
  margin: 0;
  padding: 16px 20px 0;
  overflow: hidden;
  border: 0 !important;
  border-left: 1px solid var(--ai-line, #e2ebf7) !important;
  border-radius: 24px 0 0 24px !important;
  box-shadow: -24px 0 70px rgb(15 23 42 / 0.2) !important;
  animation: ai-review-drawer-in .22s ease-out;
}

@keyframes ai-review-drawer-in {
  from { opacity: .7; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

#page-ai-review .ai-draft-detail-shell .ai-draft-decision-head {
  position: relative;
  flex: 0 0 auto;
  top: auto;
  z-index: 12;
  margin: -16px -20px 0;
  padding: 14px 20px;
  border-radius: 24px 0 0 0;
}

#page-ai-review .ai-draft-detail-shell #ai-draft-detail-panel {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 0 0;
  overflow: auto;
  scroll-padding-top: 70px;
  overscroll-behavior: contain;
}

.ai-review-stepper {
  position: sticky;
  top: 0;
  z-index: 11;
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid var(--ai-line, #e2ebf7);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 8px 22px rgb(15 43 92 / 0.07);
}

.ai-review-stepper button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ai-muted, #718096);
  cursor: pointer;
}

.ai-review-stepper button:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -5px;
  width: 10px;
  height: 1px;
  background: #dce7f5;
}

.ai-review-stepper button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #cad6e6;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.ai-review-stepper button strong { font-size: 11px; white-space: nowrap; }
.ai-review-stepper button.is-complete { color: #15803d; }
.ai-review-stepper button.is-complete span { border-color: #86efac; background: #ecfdf3; }
.ai-review-stepper button.is-active { background: #eef6ff; color: var(--ai-blue, #1677ff); }
.ai-review-stepper button.is-active span { border-color: var(--ai-blue, #1677ff); background: var(--ai-blue, #1677ff); color: #fff; }

#page-ai-review .ai-draft-review-layout { display: block; }
#page-ai-review .ai-draft-decision-sidebar { display: contents; }
#page-ai-review [data-ai-step-panel] { display: none; }
#page-ai-review [data-ai-step-panel].is-active { display: block; }
#page-ai-review .ai-draft-items-section {
  margin-top: 0;
  padding: 0;
  border-top: 0;
}

#page-ai-review .ai-draft-main-info > .ai-review-step-head,
#page-ai-review .ai-draft-decision-sidebar > section > .ai-review-step-head,
#page-ai-review .ai-items-section-head {
  display: none;
}

#page-ai-review .ai-draft-main-info {
  padding: 14px 16px 18px;
}

#page-ai-review .ai-draft-main-info .ai-review-field-group-title {
  margin: 10px 0 8px;
}

#page-ai-review .ai-draft-main-info .ai-review-field-group-title:first-of-type {
  margin-top: 0;
}

#page-ai-review .ai-draft-main-info .ai-review-field-grid {
  gap: 10px 12px;
}

#page-ai-review .ai-draft-main-info input,
#page-ai-review .ai-draft-main-info select {
  min-height: 38px !important;
}

.ai-review-step-actions {
  position: relative;
  flex: 0 0 64px;
  z-index: 2147483010;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: auto;
  min-height: 64px;
  margin: 0 -20px;
  padding: 10px 24px;
  border-top: 1px solid var(--ai-line, #e2ebf7);
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 -10px 26px rgb(15 43 92 / 0.07);
  backdrop-filter: blur(14px);
}

.ai-review-step-actions .btn:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none !important;
}

.ai-review-step-actions span {
  min-width: 76px;
  color: var(--ai-muted, #718096);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

#page-ai-review .ai-item-review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 0 0 8px;
}

#page-ai-review .ai-item-review-meta .ai-item-stats {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

#page-ai-review .ai-item-review-meta .ai-model-response-inline,
#page-ai-review .ai-item-review-meta .ai-model-response-details {
  margin: 0;
  border: 0;
  background: none;
}

#page-ai-review .ai-item-review-meta .ai-model-response-details > summary {
  padding: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

#page-ai-review .ai-balloon-warning {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  box-shadow: none;
  font-size: 12px;
  font-weight: 650;
}

#page-ai-review .ai-review-advanced,
#page-ai-review .ai-model-response-details {
  margin: 10px 0;
  border: 1px solid var(--ai-line, #e2ebf7);
  border-radius: 14px;
  background: #f8fbff;
}

#page-ai-review .ai-review-advanced > summary,
#page-ai-review .ai-model-response-details > summary {
  padding: 12px 14px;
  color: var(--ai-sub, #46566f);
  font-size: 12px;
  cursor: pointer;
}

#page-ai-review .ai-review-advanced > :not(summary) { margin-inline: 14px; }

#page-ai-review .ai-item-review-shell {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  height: clamp(380px, calc(100vh - 304px), 560px);
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--ai-line, #e2ebf7);
  border-radius: 14px;
  background: #fff;
}

#page-ai-review .ai-item-review-shell .ai-item-bulk-bar {
  position: relative;
  top: auto;
  z-index: 3;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: none;
}

#page-ai-review .ai-item-review-shell .ai-item-bulk-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#page-ai-review .ai-item-review-shell .ai-item-bulk-head strong {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

#page-ai-review .ai-item-bulk-count {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

#page-ai-review .ai-item-review-shell .ai-item-bulk-head .hint {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

#page-ai-review .ai-item-review-shell .ai-item-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin: 0;
  overflow: visible;
  padding-bottom: 0;
}

#page-ai-review .ai-item-bulk-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#page-ai-review .ai-item-bulk-fields select,
#page-ai-review .ai-item-bulk-fields input[type='text'] {
  min-height: 32px !important;
  max-width: 148px;
  border-radius: 8px !important;
}

#page-ai-review .ai-item-bulk-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#page-ai-review .ai-item-bulk-remove {
  color: #64748b !important;
}

#page-ai-review .ai-item-bulk-remove:hover {
  color: #dc2626 !important;
}

#page-ai-review .ai-item-review-shell .ai-item-workspace {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

#page-ai-review .ai-item-table-wrap {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#page-ai-review .ai-item-review-shell .ai-item-table-wrap {
  border: 0;
  border-radius: 0;
}

#page-ai-review .ai-item-review-shell .ai-item-table thead {
  position: relative;
  z-index: 5;
  transform: translateY(var(--ai-item-table-scroll-y, 0));
}

#page-ai-review .ai-item-review-shell .ai-item-table thead th {
  position: static;
}

#page-ai-review .ai-item-review-shell .ai-item-edit-panel {
  height: auto;
  max-height: none;
}

#page-ai-review .ai-item-row {
  content-visibility: auto;
  contain-intrinsic-block-size: 42px;
}

@media (max-width: 900px) {
  #page-ai-review .ai-review-overview-bar.is-collapsed { grid-template-columns: 1fr; }
  #page-ai-review .ai-review-overview-bar.is-collapsed .ai-review-kpi-grid { overflow-x: auto; }
  body.layout-pro .ai-draft-detail-shell,
  body.layout-pro #mdm-template-edit-modal.modal,
  body.layout-pro #mdmp-import-items-modal.modal,
  body.layout-pro #ped-inspection-pool-modal.modal {
    left: 0;
  }
  #page-ai-review .ai-draft-detail-shell .ai-draft-detail-card { width: 100vw; }
  #page-ai-review .ai-draft-detail-shell .ai-draft-detail-card { border-radius: 0 !important; }
  .ai-review-stepper { grid-template-columns: repeat(4, minmax(48px, 1fr)); overflow-x: auto; }
  .ai-review-stepper button { gap: 4px; }
  .ai-review-stepper button strong { display: none; }
}

@media (max-width: 1180px) {
  #page-ai-review .ai-item-review-shell .ai-item-bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #page-ai-review .ai-item-bulk-ops {
    margin-left: 0;
    justify-content: flex-end;
  }
}

@media (max-width: 700px) {
  .prod-utility-overlay {
    align-items: end;
    padding: 10px;
  }

  .prod-quick-modal-panel,
  .prod-ai-drawer-panel {
    width: 100%;
    height: auto;
    max-height: 82vh;
    border-radius: 15px;
  }

  .prod-ai-drawer-shell {
    place-items: end stretch;
  }

  #page-products .prod-ai-config-summary > div {
    display: grid;
    gap: 2px;
  }
}

.of-order-line-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr);
  gap: 8px;
}

.of-order-items-editor {
  border-top: 1px solid var(--line, #e5e7eb);
  padding-top: 10px;
}

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

.of-order-items-extra {
  display: grid;
  gap: 8px;
}

.of-tree-section-title--actions,
.of-items-edit-toolbar,
.of-items-edit-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* 流程树 & 质检资料包面板 */
.of-tree-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 2px 0 8px;
}

.of-tree-summary {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--of-line, #e5eaf2);
  background: #fff;
}

.of-tree-summary--ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.of-tree-summary--warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.of-tree-summary--block {
  border-color: #fecaca;
  background: #fef2f2;
}

.of-tree-summary-title {
  font-size: 14px;
  font-weight: 700;
  color: #1d2939;
  line-height: 1.4;
}

.of-tree-summary-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #667085;
}

.of-tree-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.of-tree-step {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #dce3ec;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.of-tree-step--done {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #15803d;
}

.of-tree-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--of-line, #e5eaf2);
}

.of-tree-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #344054;
  line-height: 1.35;
}

.of-tree-subcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--of-line, #e5eaf2);
  border-radius: 10px;
  background: #fff;
}

.of-tree-subcard + .of-tree-subcard {
  margin-top: 2px;
}

.of-tree-subcard-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d2939;
  line-height: 1.45;
  word-break: break-word;
}

.of-tree-kv {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.4;
}

.of-tree-kv-k {
  color: #667085;
  font-weight: 600;
}

.of-tree-task {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.45;
  color: #344054;
}

.of-tree-task strong {
  font-weight: 700;
  color: #1d2939;
}

.of-tree-gap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 1.45;
}

.of-tree-gap--warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.of-tree-gap--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.of-tree-gap--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.of-tree-gap-title {
  font-weight: 700;
}

.of-tree-gap-detail {
  color: inherit;
  opacity: 0.92;
}

.of-tree-gap-action {
  margin-top: 4px;
  align-self: flex-start;
}

.of-tree-gap-action--secondary {
  margin-left: 8px;
  opacity: 0.92;
}

.of-tree-subcard > .of-tree-gap-action {
  padding-top: 2px;
}

.of-tree-panel > .hint {
  font-size: 12px;
  line-height: 1.45;
  color: #667085;
}

#page-order-flow .of-order-detail-drawer .of-tool-tree {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

#page-order-flow .of-order-detail-drawer .of-tool-tree .card-head {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--of-line, #e5eaf2);
  background: #fff;
}

#page-order-flow .of-order-detail-drawer .of-tree-panel {
  padding: 0 16px 16px;
}

/* 订单工作台全页 */
#page-order-flow.order-flow-workspace-mode .order-flow-datebar,
#page-order-flow.order-flow-workspace-mode .of-flow-steps,
#page-order-flow.order-flow-workspace-mode .of-flow-profile-badge {
  display: none !important;
}

#page-order-flow .of-workspace-page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.of-ws-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.of-ws-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 12px;
  padding: 14px;
  border: 1px solid var(--of-line, #e5eaf2);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

.of-ws-sidebar-block {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--of-line, #e5eaf2);
}

.of-ws-sidebar-foot {
  margin-top: auto;
}

.of-ws-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #667085;
}

.of-ws-field select {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.of-ws-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.of-ws-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.of-ws-tab {
  display: grid;
  gap: 2px;
  min-width: 108px;
  padding: 10px 14px;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  background: #fff;
  color: #475467;
  text-align: left;
  cursor: pointer;
}

.of-ws-tab strong {
  font-size: 13px;
  color: #1d2939;
}

.of-ws-tab span {
  font-size: 11px;
  color: #667085;
}

.of-ws-tab.active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.of-ws-tab.active strong {
  color: #1d4ed8;
}

.of-ws-tab.hidden {
  display: none;
}

.of-ws-panel {
  padding: 16px;
  border: 1px solid var(--of-line, #e5eaf2);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.035);
}

.of-ws-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.of-ws-panel-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #1d2939;
}

.of-ws-archived-hint {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.of-tree-subcard--archived {
  opacity: 0.88;
  background: #fafafa;
}

.of-ws-panel-head p {
  margin: 0;
  font-size: 12px;
  color: #667085;
  line-height: 1.45;
}

.of-ws-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.of-ws-product-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 12px;
  color: #475467;
}

.of-ws-product-summary strong {
  color: #1d2939;
  font-weight: 700;
}

.of-ws-product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.of-ws-product-line {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #fff;
}

.of-ws-product-line-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.of-ws-line-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.of-ws-product-line-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.of-ws-product-code {
  font-size: 12px;
  color: #475467;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.of-ws-product-line-title strong {
  font-size: 15px;
  font-weight: 700;
  color: #1d2939;
  line-height: 1.35;
  word-break: break-word;
}

.of-ws-product-qty-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.of-ws-product-spec {
  margin: 0;
  padding-left: 2px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.of-ws-product-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.of-ws-product-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.of-ws-product-meta dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #667085;
}

.of-ws-product-meta dd {
  margin: 0;
  font-size: 12px;
  color: #344054;
  word-break: break-word;
}

.of-ws-product-meta dd.is-ok {
  color: #047857;
  font-weight: 600;
}

.of-ws-product-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 12px;
  color: #92400e;
  line-height: 1.45;
}

.of-ws-product-note span {
  font-weight: 700;
  margin-right: 6px;
}

.of-ws-product-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.of-ws-product-rules-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.of-ws-product-rules-head strong {
  color: #344054;
}

.of-ws-rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.of-ws-rule-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.45;
}

.of-ws-rule-lane {
  font-weight: 700;
  color: #1d2939;
}

.of-ws-rule-arrow {
  color: #94a3b8;
}

.of-ws-rule-tpl {
  flex: 1;
  min-width: 0;
  color: #475467;
}

.of-ws-rule-tasks {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475467;
  font-size: 11px;
  font-weight: 600;
}

.of-ws-product-line-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid #eef2f6;
}

.of-ws-gap-list {
  display: grid;
  gap: 10px;
}

.of-ws-empty {
  padding: 18px 14px;
  border: 1px dashed #dce3ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.of-ws-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.of-ws-overview-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--of-line, #e5eaf2);
  border-radius: 10px;
  background: #f8fafc;
}

.of-ws-overview-card h4 {
  margin: 0;
  font-size: 13px;
  color: #344054;
}

.of-ws-more-gaps {
  margin-top: 8px;
}

.of-ws-raw-json {
  margin-top: 0;
  max-height: 60vh;
}

@media (max-width: 1080px) {
  .of-ws-layout {
    grid-template-columns: 1fr;
  }

  .of-ws-sidebar {
    position: static;
  }

  .of-ws-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .of-ws-card-grid {
    grid-template-columns: 1fr;
  }

  .of-ws-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.of-items-edit-modal-content {
  max-width: min(1100px, 96vw);
  max-height: min(90vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.of-items-edit-modal-content > .modal-header,
.of-items-edit-modal-content > .crm-modal-actions,
.of-items-edit-modal-content > .of-items-edit-error {
  flex: 0 0 auto;
}

.of-items-edit-lead {
  margin: 4px 0 0;
  max-width: 42rem;
  font-size: 12px;
  line-height: 1.5;
}

.of-items-edit-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}

.of-items-edit-header {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fafcff;
}

.of-items-edit-header .sor-create-block-title {
  margin-bottom: 10px;
}

.of-items-edit-header .sor-create-field-grid {
  gap: 10px 14px;
}

.of-items-edit-header .of-ie-header-field.hidden {
  display: none !important;
}

.of-items-edit-header #of-ie-notes {
  min-height: 56px;
  max-height: 96px;
}

.of-items-edit-lines {
  flex: 1 1 auto;
  min-height: min(42vh, 360px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.of-items-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.of-items-edit-toolbar .sor-create-block-title {
  margin: 0 0 2px;
}

.of-items-edit-order {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.of-items-edit-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.of-items-edit-sheet {
  --of-ie-pad-x: 12px;
  --of-ie-cols: 64px minmax(160px, 2.2fr) minmax(100px, 1fr) 88px 64px 72px 128px;
  flex: 1 1 auto;
  min-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #f1f5f9;
}

.of-items-edit-sheet.hide-cust {
  --of-ie-cols: 64px minmax(200px, 2.6fr) 88px 64px 72px 128px;
}

.of-items-edit-sheet.hide-cust .of-ie-h-cust,
.of-items-edit-sheet.hide-cust .of-ie-cust {
  display: none !important;
}

.of-items-edit-sheet .of-ie-h-delivery,
.of-items-edit-sheet .of-ie-delivery {
  display: none !important;
}

.of-items-edit-cols {
  display: grid;
  grid-template-columns: var(--of-ie-cols);
  gap: 8px;
  align-items: center;
  box-sizing: border-box;
  padding: 0 var(--of-ie-pad-x);
}

.of-items-edit-cols--head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 36px;
  margin: 0 0 8px;
  padding: 0 var(--of-ie-pad-x);
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.of-items-edit-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.of-items-edit-row {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  overflow: clip;
}

.of-items-edit-row:nth-child(even) {
  background: #fbfdff;
}

.of-items-edit-row.is-expanded {
  border-color: #c7d7ef;
  box-shadow: 0 0 0 1px rgb(37 99 235 / 0.08), 0 2px 8px rgb(15 23 42 / 0.05);
}

.of-items-edit-row.is-referenced {
  box-shadow: inset 3px 0 0 #f59e0b, 0 1px 2px rgb(15 23 42 / 0.04);
}

.of-items-edit-row.is-referenced.is-expanded {
  box-shadow:
    inset 3px 0 0 #f59e0b,
    0 0 0 1px rgb(37 99 235 / 0.08),
    0 2px 8px rgb(15 23 42 / 0.05);
}

.of-items-edit-main {
  display: grid;
  grid-template-columns: var(--of-ie-cols);
  gap: 8px;
  align-items: center;
  box-sizing: border-box;
  padding: 8px var(--of-ie-pad-x);
}

.of-ie-cell {
  display: block;
  min-width: 0;
  margin: 0;
}

.of-ie-mobile-label {
  display: none;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.of-ie-cell input,
.of-ie-cell select,
.of-items-edit-extra input,
.of-items-edit-extra select,
.of-items-edit-extra textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
}

.of-ie-cell select:disabled {
  color: #64748b;
  background: #f8fafc;
  cursor: not-allowed;
}

.of-ie-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.of-ie-pill--locked {
  background: #fff7ed;
  color: #c2410c;
}

.of-ie-pill--new {
  background: #eff6ff;
  color: #1d4ed8;
}

.of-ie-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.of-ie-extra-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
  flex-shrink: 0;
}

.of-ie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.of-items-edit-extra {
  padding: 10px var(--of-ie-pad-x, 12px) 12px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}

.of-items-edit-row:nth-child(even) .of-items-edit-extra {
  background: #eef2f7;
}

.of-items-edit-extra.hidden {
  display: none !important;
}

.of-items-edit-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}

.of-items-edit-extra-grid > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.of-items-edit-extra-grid > label > input,
.of-items-edit-extra-grid > label > select,
.of-items-edit-extra-grid > label > textarea {
  width: 100%;
  min-width: 0;
}

.of-items-edit-span2 {
  grid-column: span 2;
}

.of-items-edit-extra textarea {
  resize: vertical;
  min-height: 56px;
  line-height: 1.45;
}

.of-items-edit-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}

.of-order-item-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(70px, .6fr) minmax(70px, .6fr) minmax(130px, 1fr) minmax(105px, .8fr) auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  .of-order-item-row { grid-template-columns: 1fr 1fr; }

  .of-items-edit-cols--head {
    display: none;
  }

  .of-items-edit-main {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .of-ie-product,
  .of-ie-actions,
  .of-ie-status {
    grid-column: 1 / -1;
  }

  .of-ie-mobile-label {
    display: block;
  }

  .of-ie-actions {
    justify-content: flex-start;
  }

  .of-items-edit-extra-grid {
    grid-template-columns: 1fr 1fr;
  }

  .of-items-edit-span2 {
    grid-column: 1 / -1;
  }
}

/* 订单流程看板 · 聚焦监控与处置（最终覆盖） */
#page-order-flow {
  --of-line: #e5eaf2;
  --of-muted: #667085;
  --of-bg: #f6f8fb;
}

#page-order-flow:not(.order-flow-config-mode):not(.order-flow-workspace-mode) .order-flow-hero {
  box-sizing: border-box;
  height: 92px !important;
  min-height: 88px !important;
  margin-bottom: 8px !important;
  padding: 16px 20px !important;
  border-radius: 16px !important;
}

#page-order-flow .order-flow-hero-badge {
  margin-bottom: 3px !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
}

#page-order-flow .order-flow-title {
  margin: 2px 0 3px !important;
  font-size: 23px !important;
}

#page-order-flow .order-flow-lead {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

#page-order-flow .order-flow-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: center;
}

#page-order-flow .order-flow-datebar,
#page-order-flow .of-flow-steps,
#page-order-flow .of-flow-profile-badge,
#page-order-flow .of-board-widgets {
  display: none !important;
}

#page-order-flow .of-page-tabs {
  min-height: 32px;
  height: 32px;
  margin-bottom: 8px;
}

#page-order-flow #of-tab-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#page-order-flow .of-board-filter {
  position: relative;
  order: 1;
  display: grid !important;
  grid-template-columns: minmax(260px, 1.8fr) minmax(130px, .7fr) minmax(130px, .7fr) auto auto auto !important;
  align-items: center;
  gap: 8px !important;
  min-height: 52px;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 12px;
}

#page-order-flow .of-board-filter::before { display: none !important; }

#page-order-flow .of-board-filter > label > .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

#page-order-flow .of-board-filter > label {
  display: block;
}

#page-order-flow .of-board-filter input,
#page-order-flow .of-board-filter select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
}

#page-order-flow .of-filter-more {
  position: relative;
}

#page-order-flow .of-filter-more > summary {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

#page-order-flow .of-filter-more-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 420px;
  padding: 14px;
  border: 1px solid var(--of-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgb(15 23 42 / .16);
}

#page-order-flow .of-filter-more-popover label {
  display: grid;
  gap: 5px;
  color: var(--of-muted);
  font-size: 12px;
}

#page-order-flow .of-filter-more-popover label:last-child {
  grid-column: 1 / -1;
}

#page-order-flow .of-kpi-grid {
  order: 2;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
}

#page-order-flow .of-kpi {
  min-height: 70px !important;
  padding: 8px 12px 7px 48px !important;
  border-radius: 12px !important;
}

#page-order-flow .of-kpi strong {
  margin: 3px 0 1px !important;
  font-size: 23px !important;
}

#page-order-flow .of-exception-queue {
  order: 3;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--of-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

#page-order-flow .of-exception-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

#page-order-flow .of-exception-head h3,
#page-order-flow .of-exception-head p {
  margin: 0;
}

#page-order-flow .of-exception-head h3 {
  color: #1d2939;
  font-size: 14px;
}

#page-order-flow .of-exception-head p {
  display: none;
}

#page-order-flow #of-exception-count {
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-size: 11px;
  font-weight: 800;
}

#page-order-flow .of-exception-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#page-order-flow .of-exception-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #fee2e2;
  border-radius: 9px;
  background: #fffafa;
}

#page-order-flow .of-exception-item strong,
#page-order-flow .of-exception-item p {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-order-flow .of-exception-item strong { font-size: 12px; color: #344054; }
#page-order-flow .of-exception-item p { margin-top: 2px; font-size: 11px; color: #b42318; }
#page-order-flow .of-exception-level { width: 6px; height: 28px; overflow: hidden; color: transparent; border-radius: 999px; background: #f04438; }
#page-order-flow .of-exception-empty { padding: 10px; border-radius: 8px; background: #f0fdf4; color: #15803d; font-size: 12px; }

#page-order-flow .order-flow-zone--table {
  order: 4;
  margin: 0 !important;
}

#page-order-flow .of-so-list-card {
  border-radius: 12px !important;
  overflow: hidden;
}

#page-order-flow .of-board-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

#page-order-flow .of-board-table th:nth-child(1) { width: 15%; }
#page-order-flow .of-board-table th:nth-child(2) { width: 17%; }
#page-order-flow .of-board-table th:nth-child(3) { width: 11%; }
#page-order-flow .of-board-table th:nth-child(4) { width: 13%; }
#page-order-flow .of-board-table th:nth-child(5) { width: 16%; }
#page-order-flow .of-board-table th:nth-child(6) { width: 10%; }
#page-order-flow .of-board-table th:nth-child(7) { width: 10%; }
#page-order-flow .of-board-table th:nth-child(8) { width: 110px; }

#page-order-flow .of-board-table td {
  overflow: hidden;
  vertical-align: middle;
}

#page-order-flow .of-order-link {
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #175cd3;
  font: inherit;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

#page-order-flow .of-product-title,
#page-order-flow .of-product-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-order-flow .of-product-title { color: #344054; font-size: 12px; }
#page-order-flow .of-product-sub { margin-top: 3px; color: #98a2b3; font-size: 11px; }
#page-order-flow .of-progress { height: 5px; overflow: hidden; border-radius: 999px; background: #eaf0f7; }
#page-order-flow .of-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f7dff, #22c1dc); }
#page-order-flow .of-progress-label { display: block; margin-top: 4px; color: #667085; font-size: 10px; }
#page-order-flow .of-task-count { color: #667085; font-size: 11px; }
#page-order-flow .of-task-count--warn { color: #b42318; font-weight: 700; }
#page-order-flow .of-row-actions { display: flex; gap: 4px; white-space: nowrap; }

#page-order-flow .of-drawer-backdrop {
  display: none;
  position: fixed;
  z-index: 5000;
  inset: 0;
  background: rgb(15 23 42 / .34);
  backdrop-filter: blur(2px);
}

#page-order-flow .of-drawer-backdrop.is-open { display: block; }

#page-order-flow .of-drawer-head {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--of-line);
  background: rgb(255 255 255 / .96);
}

#page-order-flow .of-drawer-head h3 { margin: 2px 0 0; color: #1d2939; font-size: 18px; }
#page-order-flow .of-drawer-eyebrow { color: #2f7dff; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
#page-order-flow .of-drawer-close { width: 34px; height: 34px; border: 1px solid #dce3ec; border-radius: 999px; background: #fff; color: #475467; font-size: 22px; cursor: pointer; }

#page-order-flow .order-flow-zone--onboard {
  display: none !important;
  position: fixed !important;
  z-index: 5001;
  inset: 0 0 0 auto;
  width: min(620px, 94vw);
  height: 100dvh;
  margin: 0 !important;
  overflow: auto;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--of-bg) !important;
  box-shadow: -20px 0 60px rgb(15 23 42 / .18) !important;
}

#page-order-flow .order-flow-zone--onboard[open] { display: block !important; }
#page-order-flow .order-flow-zone--onboard .order-flow-grid--onboard { display: block !important; padding: 16px; }
#page-order-flow .order-flow-zone--onboard .of-onboard-card { display: none; width: 100%; margin: 0; }
#page-order-flow .order-flow-zone--onboard[data-mode="so"] .of-step-so,
#page-order-flow .order-flow-zone--onboard[data-mode="batch"] .of-step-wb,
#page-order-flow .order-flow-zone--onboard[data-mode="sn"] .of-step-sn { display: block; }

#page-order-flow .of-order-detail-drawer {
  display: none;
  position: fixed !important;
  z-index: 5001;
  inset: 0 0 0 auto;
  width: min(720px, 96vw);
  height: 100dvh;
  margin: 0 !important;
  overflow: auto;
  border: 0 !important;
  background: var(--of-bg);
  box-shadow: -20px 0 60px rgb(15 23 42 / .18);
}

#page-order-flow .of-order-detail-drawer.is-open { display: block; }
#page-order-flow .of-order-detail-drawer .order-flow-tools { display: block !important; height: auto !important; padding: 0; }
#page-order-flow .of-order-detail-drawer .of-tool-tree { width: 100% !important; min-height: 0 !important; height: auto !important; }
#page-order-flow .of-order-detail-drawer .order-flow-tools-col { display: none !important; }
#page-order-flow .of-order-detail-drawer .of-toolbar {
  position: sticky;
  z-index: 3;
  top: 69px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--of-line, #e5eaf2);
  background: #fff;
}
#page-order-flow .of-order-detail-drawer .of-toolbar .of-input-grow { grid-column: 1; width: 100%; }
#page-order-flow .of-order-detail-drawer .of-toolbar-profile { grid-column: 2; flex-direction: column; align-items: flex-start; gap: 4px; }
#page-order-flow .of-order-detail-drawer .of-toolbar-profile select { min-width: 160px; }
#page-order-flow .of-order-detail-drawer .of-toolbar-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 900px) {
  #page-order-flow .order-flow-hero { align-items: center !important; }
  #page-order-flow .of-board-filter { grid-template-columns: minmax(220px, 1fr) 1fr 1fr auto !important; }
  #page-order-flow .of-filter-search { grid-column: span 2; }
  #page-order-flow .of-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #page-order-flow .of-exception-list { grid-template-columns: 1fr; }
  #page-order-flow .of-board-table { min-width: 880px !important; }
}

/* 订单看板 / 配置 / 工作台：hero 统一圆角与高度基线，用 mode 区分内容而非换皮肤 */
body.layout-pro #page-order-flow .order-flow-hero.task-command-hero {
  height: auto !important;
  min-height: 108px !important;
  margin-bottom: 8px !important;
  padding: 14px 20px !important;
  border-radius: 16px !important;
  border: 1px solid #e6edf5 !important;
  background: linear-gradient(135deg, #fff, #f7fbff) !important;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.04) !important;
}

body.layout-pro #page-order-flow .order-flow-hero.task-command-hero::after {
  right: 28px !important;
  width: 118px !important;
  height: 118px !important;
}

body.layout-pro #page-order-flow #of-tab-board,
body.layout-pro #page-order-flow .of-board-filter {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.layout-pro #page-order-flow .of-board-filter {
  grid-template-columns: minmax(220px, 1.8fr) minmax(130px, .72fr) minmax(130px, .72fr) max-content max-content max-content !important;
}

body.layout-pro #page-order-flow .of-board-filter > * {
  min-width: 0;
}

body.layout-pro #page-order-flow .of-board-filter > button,
body.layout-pro #page-order-flow .of-filter-more > summary {
  white-space: nowrap;
}

/* 订单流程配置 · 三视图管理台 */
#page-order-flow #of-tab-config {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 10px;
}

#page-order-flow .of-config-intro {
  position: relative;
  min-height: 88px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #f5f9ff);
}

#page-order-flow .of-config-intro-badge { margin-bottom: 3px; color: #2f7dff; font-weight: 850; }
#page-order-flow .of-config-intro-title { margin-bottom: 3px; font-size: 19px; }
#page-order-flow .of-config-intro-lead { margin: 0; }

#page-order-flow .of-config-priority-help {
  position: absolute;
  top: 18px;
  right: 18px;
}

#page-order-flow .of-config-priority-help > summary {
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#page-order-flow .of-config-priority-help[open] {
  z-index: 20;
  padding: 10px 12px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgb(15 23 42 / .14);
}

#page-order-flow .of-config-priority-help .of-config-priority { margin-top: 10px; }

#page-order-flow .of-config-view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  border: 1px solid #e1e8f2;
  border-radius: 14px;
  background: #eef3f9;
}

#page-order-flow .of-config-view-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  height: 100%;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px !important;
  background: transparent;
  color: #667085;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

#page-order-flow .of-config-view-tab strong { color: #344054; font-size: 13px; white-space: nowrap; }
#page-order-flow .of-config-view-tab span { font-size: 11px; color: #98a2b3; }
#page-order-flow .of-config-view-tab.active {
  border-color: #d8e6fb;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d8e6fb;
}
#page-order-flow .of-config-view-tab.active strong { color: #175cd3; }
#page-order-flow .of-config-view-tab.active span { color: #667085; }

#page-order-flow .of-config-section {
  border: 1px solid #e1e8f2;
  border-radius: 14px;
  box-shadow: none;
}

#page-order-flow .of-config-section-head {
  padding: 13px 16px;
  border-bottom: 1px solid #edf1f6;
}

#page-order-flow .of-config-step-no { display: none; }
#page-order-flow .of-config-section-head h3 { margin-bottom: 2px; font-size: 15px; }
#page-order-flow .of-config-section-head-main { gap: 0; }

#page-order-flow .of-config-more-actions { position: relative; }
#page-order-flow .of-config-more-actions > summary { list-style: none; cursor: pointer; }
#page-order-flow .of-config-more-menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 176px;
  padding: 6px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgb(15 23 42 / .14);
}

#page-order-flow .of-config-more-menu button,
#page-order-flow .of-config-more-menu label {
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #344054;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

#page-order-flow .of-config-more-menu button:hover,
#page-order-flow .of-config-more-menu label:hover { background: #f2f6fb; }

#page-order-flow .of-config-master-detail {
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 540px;
  border-top: 0;
}

#page-order-flow .of-config-template-nav {
  max-height: 620px;
  padding: 10px;
  border-right-color: #e5eaf2;
  background: #f8fafc;
}

#page-order-flow .of-config-template-filter {
  position: sticky;
  z-index: 3;
  top: -10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 6px;
  padding: 0 0 10px;
  background: #f8fafc;
}

#page-order-flow .of-config-template-filter input,
#page-order-flow .of-config-template-filter select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

#page-order-flow .of-config-template-list { gap: 5px; }

#page-order-flow .of-config-tpl-item {
  gap: 5px;
  padding: 10px 11px;
  border-color: transparent;
  border-radius: 9px;
  box-shadow: none;
}

#page-order-flow .of-config-tpl-item:hover { border-color: #cbdcf5; background: #fff; }
#page-order-flow .of-config-tpl-item.active { border-color: #b9d3fb; background: #edf5ff; box-shadow: inset 3px 0 #2f7dff; }

#page-order-flow .of-config-tpl-main,
#page-order-flow .of-config-tpl-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

#page-order-flow .of-config-tpl-sub code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#page-order-flow .of-config-tpl-sub span { color: #667085; font-size: 11px; white-space: nowrap; }
#page-order-flow .of-config-default-tag { padding: 2px 6px; border-radius: 999px; background: #dbeafe; color: #175cd3; font-size: 10px; font-weight: 800; }
#page-order-flow .of-config-tpl-item-foot { justify-content: flex-start; min-width: 0; }
#page-order-flow .of-config-tpl-item-foot .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#page-order-flow .of-config-list-empty { margin: 18px 8px; color: #98a2b3; font-size: 12px; text-align: center; }

#page-order-flow .of-config-template-detail {
  max-height: 620px;
  padding: 16px 18px 72px;
  background: #fff;
}

#page-order-flow .of-profile-editor-form { position: relative; }
#page-order-flow .of-config-detail-head,
#page-order-flow .of-config-cap-block,
#page-order-flow .of-config-ready-block,
#page-order-flow .of-config-onboard-block {
  padding: 14px;
  border: 1px solid #e7ecf3;
  border-radius: 10px;
  background: #fbfcfe;
}

#page-order-flow .of-config-onboard-block {
  border-color: #c7ddff;
  background: linear-gradient(180deg, #f8fbff 0%, #fbfcfe 100%);
}

#page-order-flow .of-config-detail-head { margin-bottom: 10px; }
#page-order-flow .of-config-cap-block,
#page-order-flow .of-config-ready-block { margin-bottom: 10px; }

#page-order-flow .of-profile-editor-actions {
  position: sticky;
  z-index: 4;
  bottom: -72px;
  margin: 18px -18px -72px;
  padding: 12px 18px;
  border-top: 1px solid #e5eaf2;
  background: rgb(255 255 255 / .96);
  box-shadow: 0 -8px 20px rgb(15 23 42 / .05);
}

#page-order-flow [data-config-panel="default"] .of-config-section-body {
  display: block;
}

#page-order-flow [data-config-panel="default"] .of-config-preview-inline { min-height: 0; }

/* 默认规则：分卡片说明，避免长文 + 挤成一排 */
#page-order-flow .of-config-default-page .of-config-rule-stack {
  display: grid;
  gap: 14px;
  padding: 4px 18px 20px;
}

#page-order-flow .of-config-rule-card {
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

#page-order-flow .of-config-rule-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f6;
  background: #f8fafc;
}

#page-order-flow .of-config-rule-card-head strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

#page-order-flow .of-config-rule-card-head span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

#page-order-flow .of-config-rule-card-body {
  padding: 14px 16px 16px;
}

#page-order-flow .of-config-rule-card-body--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

#page-order-flow .of-config-rule-grid {
  display: grid;
  gap: 12px 14px;
}

#page-order-flow .of-config-rule-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#page-order-flow .of-config-rule-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#page-order-flow .of-config-rule-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

#page-order-flow .of-config-rule-field > span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

#page-order-flow .of-config-rule-field small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

#page-order-flow .of-config-rule-field input,
#page-order-flow .of-config-rule-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 0 11px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}

#page-order-flow .of-config-rule-field input:focus,
#page-order-flow .of-config-rule-field select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

#page-order-flow .of-config-rule-subhead {
  display: grid;
  gap: 2px;
  margin: 0 16px;
  padding: 12px 0 0;
  border-top: 1px dashed #e5eaf2;
}

#page-order-flow .of-config-rule-subhead strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
}

#page-order-flow .of-config-rule-subhead span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

#page-order-flow .of-config-rule-note {
  margin: 0;
  padding: 0 16px 14px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

#page-order-flow .of-config-rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#page-order-flow .of-config-preview-inline--in-card {
  margin: 0;
  padding: 0 16px 14px;
  border-top: 0;
}

#page-order-flow .of-config-rule-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 960px) {
  #page-order-flow .of-config-rule-grid--2,
  #page-order-flow .of-config-rule-grid--3,
  #page-order-flow .of-config-rule-side-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  #page-order-flow .of-config-view-tab { display: grid; gap: 2px; }
  #page-order-flow .of-config-view-tab span { display: none; }
  #page-order-flow .of-config-master-detail { grid-template-columns: 1fr; }
  #page-order-flow .of-config-template-nav { max-height: 230px; border-right: 0; border-bottom: 1px solid #e5eaf2; }
  #page-order-flow .of-config-template-detail { max-height: none; }
  #page-order-flow .of-config-priority-help { position: static; margin-top: 8px; }
}

/* 流程配置工作台 · 动态页头与单层导航 */
#page-order-flow.order-flow-config-mode .order-flow-hero {
  width: 100%;
  max-width: 1400px;
  height: auto !important;
  min-height: 104px !important;
  margin: 0 auto 10px !important;
  padding: 18px 24px !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: start !important;
  gap: 12px 20px;
}

#page-order-flow.order-flow-config-mode .order-flow-hero::after {
  display: none !important;
}

#page-order-flow.order-flow-config-mode .order-flow-hero__main {
  grid-column: 1;
  grid-row: 1;
  flex: none;
  min-width: 0;
  max-width: none;
  padding-right: 0;
}

#page-order-flow.order-flow-config-mode .order-flow-hero-actions {
  position: static !important;
  top: auto !important;
  right: auto !important;
  grid-column: 2;
  grid-row: 1;
  z-index: 3;
  flex-shrink: 0;
  align-self: start !important;
  justify-self: end;
  margin: 0 !important;
}

body.layout-pro #page-order-flow.order-flow-config-mode .order-flow-hero.task-command-hero {
  width: 100% !important;
  max-width: 1400px !important;
  height: auto !important;
  min-height: 108px !important;
  margin: 0 auto 10px !important;
  padding: 14px 20px !important;
  border-radius: 16px !important;
  border: 1px solid #e6edf5 !important;
  background: linear-gradient(135deg, #fff, #f7fbff) !important;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.04) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start !important;
  gap: 12px 20px;
}

body.layout-pro #page-order-flow.order-flow-config-mode .order-flow-hero.task-command-hero::after {
  display: none !important;
}

body.layout-pro #page-order-flow.order-flow-config-mode .order-flow-hero.task-command-hero .order-flow-hero-actions,
body.layout-pro #page-order-flow.order-flow-config-mode .order-flow-hero.task-command-hero > .order-flow-hero-actions {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
}

#page-order-flow.order-flow-config-mode #of-tab-config {
  height: auto;
  min-height: 0;
}

#page-order-flow.order-flow-config-mode .of-config-view-tabs {
  flex: 0 0 auto;
}

#page-order-flow.order-flow-config-mode #of-profile-admin-panel {
  display: flex;
  flex-direction: column;
  height: clamp(420px, calc(100dvh - 305px), 700px);
  min-height: 0;
  overflow: hidden;
}

#page-order-flow.order-flow-config-mode #of-hero-badge,
body.layout-pro #page-order-flow.order-flow-config-mode #of-hero-badge,
body.layout-pro #page-order-flow.order-flow-config-mode .order-flow-hero.task-command-hero #of-hero-badge {
  display: none !important;
}

#page-order-flow.order-flow-config-mode #of-hero-badge::after,
body.layout-pro #page-order-flow.order-flow-config-mode #of-hero-badge::after {
  content: none !important;
}

#page-order-flow.order-flow-config-mode #of-profile-admin-panel > .of-config-section-head {
  flex: 0 0 auto;
}

#page-order-flow.order-flow-config-mode #of-profile-admin-panel > .of-profile-admin-hint {
  flex: 0 0 auto;
}

#page-order-flow.order-flow-config-mode #of-profile-admin-panel .of-config-master-detail {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

#page-order-flow.order-flow-config-mode #of-profile-admin-panel .of-config-template-nav,
#page-order-flow.order-flow-config-mode #of-profile-admin-panel .of-config-template-detail {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#page-order-flow .of-config-tpl-item .badge {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
}

#page-order-flow .of-config-tpl-item-foot {
  flex-wrap: nowrap;
}

#page-order-flow .of-config-tpl-item-foot > .hint {
  min-width: 0;
}

@media (max-width: 960px) {
  #page-order-flow.order-flow-config-mode #of-profile-admin-panel {
    height: auto;
    min-height: 620px;
    overflow: visible;
  }

  #page-order-flow.order-flow-config-mode #of-profile-admin-panel .of-config-master-detail {
    overflow: visible;
  }

  #page-order-flow.order-flow-config-mode #of-profile-admin-panel .of-config-template-nav,
  #page-order-flow.order-flow-config-mode #of-profile-admin-panel .of-config-template-detail {
    height: auto;
    overflow: visible;
  }
}

#page-product-field-config .pfc-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#page-product-field-config .pfc-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
}

#page-product-field-config .pfc-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

#page-product-field-config .pfc-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#page-product-field-config .pfc-stage-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  max-width: 100%;
  padding: 0;
  overflow-x: auto;
  background: #f0f2f5;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
}

#page-product-field-config .pfc-stage-tab {
  appearance: none;
  flex: 0 0 auto;
  border: none;
  border-right: 1px solid #dbe3ef;
  background: transparent;
  border-radius: 0;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#page-product-field-config .pfc-stage-tab:last-child {
  border-right: none;
}

#page-product-field-config .pfc-stage-tab:hover:not(.is-active) {
  background: rgb(255 255 255 / 0.72);
  color: #334155;
}

#page-product-field-config .pfc-stage-tab.is-active {
  background: #fff;
  color: hsl(var(--primary));
  box-shadow: inset 0 -2px 0 hsl(var(--primary));
}

#page-product-field-config .pfc-stage-tab:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: -2px;
  z-index: 1;
}

#page-product-field-config .pfc-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
}

#page-product-field-config .pfc-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#page-product-field-config .pfc-fields-table td small {
  display: block;
  margin-top: 2px;
}

#page-product-field-config .pfc-custom-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
}

#page-product-field-config .pfc-inherit-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
}

#page-product-field-config .pfc-override-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
}

#page-product-field-config .pfc-scope-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
}

#page-product-field-config .pfc-scope-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#page-product-field-config .pfc-scope-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

#page-product-field-config .pfc-scope-controls select {
  min-width: 180px;
}

.ped-field-override-section:not(.ped-more-admin-row) {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.ped-more-admin-row.ped-field-override-section {
  border: none;
  background: transparent;
}

.ped-field-override-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ped-field-override-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

#page-product-field-config .pfc-product-wrap {
  min-width: min(100%, 320px);
}

#page-product-field-config .pfc-product-picker {
  position: relative;
  min-width: 280px;
}

#page-product-field-config .pfc-product-picker input[type='text'] {
  width: 100%;
  min-width: 0;
}

#page-product-field-config .pfc-product-combo {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow: auto;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgb(15 23 42 / 0.14);
}

#page-product-field-config .pfc-product-combo__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  text-align: left;
  cursor: pointer;
}

#page-product-field-config .pfc-product-combo__item:hover {
  background: #f2f6fb;
}

#page-product-field-config .pfc-product-combo__item strong {
  font-size: 13px;
}

#page-product-field-config .pfc-product-combo__item span {
  color: #667085;
  font-size: 12px;
}

#page-product-field-config .pfc-product-combo__empty {
  padding: 10px;
  color: #98a2b3;
  font-size: 12px;
}

#page-product-field-config .pfc-product-stage-chip {
  padding: 10px 14px;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
}

#page-product-field-config .pfc-preview-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#page-product-field-config .pfc-preview-section strong {
  display: block;
  margin-bottom: 8px;
}

#page-product-field-config .pfc-preview-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-product-field-config .pfc-preview-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
}

#page-product-field-config .pfc-preview-chip.is-required {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.pfc-custom-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 520px;
  width: calc(100vw - 32px);
}

.pfc-custom-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.pfc-custom-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.pfc-custom-form-head,
.pfc-custom-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pfc-inline-check {
  flex-direction: row !important;
  align-items: center;
}

#page-product-edit [data-ped-field].hidden,
#page-product-edit [data-pfc-custom].hidden,
#page-product-edit .ped-custom-fields-section.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  #page-product-field-config .pfc-workspace {
    grid-template-columns: 1fr;
  }
}

.dip-inheritance-readonly {
  margin: 0 0 10px;
}

.dip-inheritance-hint {
  margin: 0 0 12px;
  font-size: 12px;
}

/* 维护阶段图纸弹窗：表格优先，策略收起 */
#ped-stage-drawings-modal .ped-psd-modal {
  width: min(920px, 96vw);
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 14px;
}

#ped-stage-drawings-modal .modal-head {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
}

#ped-stage-drawings-modal .modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

#ped-stage-drawings-modal .ped-psd-lead {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  max-width: 560px;
}

#ped-stage-drawings-modal .ped-psd-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}

#ped-stage-drawings-modal .ped-psd-table-wrap {
  flex: 1 1 auto;
  min-height: 220px;
  margin: 0;
  overflow: auto;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fff;
}

#ped-stage-drawings-modal .ped-psd-table-wrap.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

#ped-stage-drawings-modal .ped-psd-table-wrap.is-empty table {
  width: 100%;
  height: 100%;
}

#ped-stage-drawings-modal .ped-psd-table-wrap.is-empty thead {
  display: none;
}

#ped-stage-drawings-modal .ped-psd-table-wrap.is-empty td {
  border: none;
  background: transparent;
}

#ped-stage-drawings-modal .ped-psd-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
}

#ped-stage-drawings-modal .ped-psd-empty strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
}

#ped-stage-drawings-modal .ped-psd-empty p {
  margin: 0;
  max-width: 360px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

#ped-stage-drawings-modal .ped-psd-loading {
  padding: 28px 16px;
  text-align: center;
}

#ped-stage-drawings-modal .ped-psd-policy {
  margin: 0;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}

#ped-stage-drawings-modal .ped-psd-policy-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: #64748b;
  font-size: 12px;
}

#ped-stage-drawings-modal .ped-psd-policy-summary::-webkit-details-marker {
  display: none;
}

#ped-stage-drawings-modal .ped-psd-policy-summary::before {
  content: '▸';
  color: #94a3b8;
}

#ped-stage-drawings-modal .ped-psd-policy[open] .ped-psd-policy-summary::before {
  content: '▾';
}

#ped-stage-drawings-modal .ped-psd-policy-summary strong {
  color: #334155;
  font-weight: 750;
}

#ped-stage-drawings-modal .ped-psd-policy-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #e8eef6;
  border-radius: 10px;
  background: #f8fafc;
}

#ped-stage-drawings-modal .ped-psd-policy-body .dip-inheritance-hint {
  margin: 0;
  flex: 1 1 240px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

/* ========== 系统管理 · 检验结构策略 ========== */
.isp-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

.isp-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
}

.isp-hero-badge {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1677ff;
}

.isp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.isp-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.isp-global-form,
.isp-product-picker,
.isp-product-editor {
  padding: 12px 16px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.isp-product-search-label {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}

.isp-product-combo {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.12);
  max-height: 240px;
  overflow-y: auto;
}

.isp-product-combo__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.isp-product-combo__item:hover {
  background: #f5f8fc;
}

.isp-product-combo__empty {
  padding: 8px 12px;
  color: #64748b;
}

.isp-product-summary {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.isp-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.isp-empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

.isp-empty-state strong {
  color: #1e293b;
}

.isp-empty-state span {
  flex: 1 1 auto;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 760px) {
  .isp-empty-state {
    align-items: flex-start;
    flex-direction: column;
  }
}

.of-ws-structure-banner {
  margin-bottom: 10px;
}

.of-ws-row-structure {
  margin-top: 4px;
}

.qc-overview-structure-readonly {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #f8fafc;
}

.qc-overview-structure-readonly select {
  min-width: 210px;
  min-height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 30px 0 10px;
  background: #fff;
  color: #1e293b;
}

.qc-structure-source-pill {
  font-size: 12px;
}

.btn-link {
  border: none;
  background: none;
  padding: 0;
  color: #1677ff;
  cursor: pointer;
  font: inherit;
}

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

/* 订单工作台 · 单据处理台布局优化 */
#page-order-flow.order-flow-workspace-mode {
  --of-workspace-line: #dfe7f2;
  --of-workspace-soft: #f4f7fb;
  --of-workspace-ink: #182230;
}

body.layout-pro #page-order-flow.order-flow-workspace-mode .order-flow-hero.task-command-hero,
#page-order-flow.order-flow-workspace-mode .order-flow-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 108px !important;
  height: auto !important;
  margin: 0 0 10px !important;
  padding: 14px 20px !important;
  border: 1px solid #e6edf5 !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #fff, #f7fbff) !important;
  box-shadow: 0 8px 22px rgb(15 23 42 / 0.04) !important;
}

body.layout-pro #page-order-flow.order-flow-workspace-mode .order-flow-hero.task-command-hero::after,
#page-order-flow.order-flow-workspace-mode .order-flow-hero::after,
#page-order-flow.order-flow-workspace-mode .order-flow-hero::before {
  display: none !important;
}

#page-order-flow.order-flow-workspace-mode .order-flow-hero__main {
  min-width: 0;
  max-width: none;
  padding: 0;
}

#page-order-flow.order-flow-workspace-mode .order-flow-hero-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px !important;
  color: #2563eb;
  font-size: 11px !important;
  font-weight: 850;
  letter-spacing: .08em;
}

#page-order-flow.order-flow-workspace-mode .order-flow-title {
  margin: 0 !important;
  color: var(--of-workspace-ink);
  font-size: 22px !important;
  line-height: 1.25 !important;
}

#page-order-flow.order-flow-workspace-mode .order-flow-lead {
  display: none !important;
}

#page-order-flow.order-flow-workspace-mode .order-flow-hero-actions {
  position: static !important;
  justify-self: end;
  align-self: center !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(720px, 52vw);
  margin: 0 !important;
}

#page-order-flow.order-flow-workspace-mode .order-flow-hero-actions .btn {
  min-height: 34px;
  border-radius: 8px;
  white-space: nowrap;
}

#page-order-flow.order-flow-workspace-mode .of-workspace-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-layout {
  grid-template-columns: clamp(260px, 19vw, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: calc(100dvh - 176px);
}

#page-order-flow.order-flow-workspace-mode .of-ws-sidebar {
  top: 10px;
  gap: 10px;
  padding: 10px;
  border-color: var(--of-workspace-line);
  border-radius: 10px;
  background: var(--of-workspace-soft);
  box-shadow: none;
}

#page-order-flow.order-flow-workspace-mode .of-tree-summary {
  padding: 12px;
  border-radius: 8px;
  box-shadow: inset 3px 0 rgb(37 99 235 / .28);
}

#page-order-flow.order-flow-workspace-mode .of-tree-summary--warn {
  box-shadow: inset 3px 0 #f59e0b;
}

#page-order-flow.order-flow-workspace-mode .of-tree-summary--block {
  box-shadow: inset 3px 0 #ef4444;
}

#page-order-flow.order-flow-workspace-mode .of-tree-summary-title {
  font-size: 13px;
}

#page-order-flow.order-flow-workspace-mode .of-tree-summary-hint {
  margin-top: 5px;
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-sidebar-block {
  gap: 8px;
  padding-top: 10px;
}

#page-order-flow.order-flow-workspace-mode .of-tree-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

#page-order-flow.order-flow-workspace-mode .of-tree-step {
  justify-content: space-between;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-sidebar-foot {
  padding-top: 10px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-sidebar-foot .btn {
  width: 100%;
  justify-content: center;
}

#page-order-flow.order-flow-workspace-mode .of-ws-main {
  gap: 10px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-tabs {
  display: inline-grid;
  grid-template-columns: repeat(5, minmax(108px, 1fr));
  gap: 0;
  width: min(760px, 100%);
  padding: 4px;
  border: 1px solid var(--of-workspace-line);
  border-radius: 10px;
  background: #eef3f9;
}

#page-order-flow.order-flow-workspace-mode .of-ws-tab {
  min-width: 0;
  min-height: 48px;
  padding: 7px 12px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
}

#page-order-flow.order-flow-workspace-mode .of-ws-tab strong {
  font-size: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-tab span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-order-flow.order-flow-workspace-mode .of-ws-tab.active {
  border-color: #c7d7ee;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / .05);
}

#page-order-flow.order-flow-workspace-mode .of-ws-panel {
  padding: 14px 16px 16px;
  border-color: var(--of-workspace-line);
  border-radius: 10px;
  box-shadow: none;
}

#page-order-flow.order-flow-workspace-mode .of-ws-panel-head {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f6;
}

#page-order-flow.order-flow-workspace-mode .of-ws-panel-head h3 {
  margin-bottom: 2px;
  font-size: 15px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-summary {
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--of-workspace-line);
  border-radius: 8px;
  background: #f8fafc;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-list {
  gap: 10px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-line {
  gap: 10px;
  padding: 12px 14px;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .9);
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-line-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-code {
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-line-title strong {
  font-size: 14px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-meta {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fff;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-meta > div {
  min-height: 54px;
  padding: 9px 12px;
  border-right: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
  background: #f8fafc;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-meta > div:last-child {
  border-right: 0;
  border-bottom: 0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-rules {
  gap: 6px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-rule-list {
  gap: 4px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-rule-item {
  display: grid;
  grid-template-columns: max-content 14px minmax(0, 1fr) max-content;
  padding: 7px 10px;
  border: 1px solid #edf1f6;
  background: #fbfcfe;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-line-foot {
  padding-top: 8px;
}

@media (max-width: 1200px) {
  #page-order-flow.order-flow-workspace-mode .of-ws-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-product-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body.layout-pro #page-order-flow.order-flow-workspace-mode .order-flow-hero.task-command-hero,
  #page-order-flow.order-flow-workspace-mode .order-flow-hero {
    grid-template-columns: 1fr;
  }

  #page-order-flow.order-flow-workspace-mode .order-flow-hero-actions {
    justify-self: start;
    max-width: 100%;
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-layout {
    grid-template-columns: 1fr;
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-sidebar {
    position: static;
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 640px) {
  #page-order-flow.order-flow-workspace-mode .of-ws-product-line-head,
  #page-order-flow.order-flow-workspace-mode .of-ws-rule-item {
    grid-template-columns: 1fr;
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-product-qty-pill {
    justify-self: start;
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-product-meta {
    grid-template-columns: 1fr;
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-product-meta > div {
    border-right: 0;
    border-bottom: 1px solid #edf1f6;
  }

  #page-order-flow.order-flow-workspace-mode .of-ws-product-meta > div:last-child {
    border-bottom: 0;
  }
}
/* 订单工作台 · 对齐 QCOS 设计系统（单栏 + 标准表格） */

#page-order-flow.order-flow-workspace-mode .of-workspace-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 14px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
}

#page-order-flow.order-flow-workspace-mode .of-ws-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#page-order-flow.order-flow-workspace-mode .of-ws-status-pill--ok {
  background: #ecfdf3;
  color: #027a48;
}

#page-order-flow.order-flow-workspace-mode .of-ws-status-pill--warn {
  background: #fffaeb;
  color: #b54708;
}

#page-order-flow.order-flow-workspace-mode .of-ws-status-pill--block {
  background: #fef3f2;
  color: #b42318;
}

#page-order-flow.order-flow-workspace-mode .of-ws-summary-meta,
#page-order-flow.order-flow-workspace-mode .of-ws-summary-reason {
  font-size: 12px;
  color: #667085;
}

#page-order-flow.order-flow-workspace-mode .of-ws-steps-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#page-order-flow.order-flow-workspace-mode .of-ws-steps-card .of-flow-steps {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#page-order-flow.order-flow-workspace-mode .of-flow-steps--readonly .of-flow-step {
  cursor: default;
  pointer-events: none;
}

#page-order-flow.order-flow-workspace-mode .of-ws-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  background: #eef3f9;
}

#page-order-flow.order-flow-workspace-mode .of-ws-view-tab {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

#page-order-flow.order-flow-workspace-mode .of-ws-view-tab:hover {
  color: #175cd3;
  background: rgb(255 255 255 / .6);
}

#page-order-flow.order-flow-workspace-mode .of-ws-view-tab.active {
  border-color: #c7d7ee;
  background: #fff;
  color: #175cd3;
  box-shadow: 0 1px 2px rgb(15 23 42 / .06);
}

#page-order-flow.order-flow-workspace-mode .of-ws-view-tab.hidden {
  display: none;
}

#page-order-flow.order-flow-workspace-mode .of-ws-panel.card {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#page-order-flow.order-flow-workspace-mode .of-ws-panel .card-head {
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f6;
}

#page-order-flow.order-flow-workspace-mode .of-ws-panel .table-wrap {
  padding: 0 0 4px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-table .of-order-link {
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#page-order-flow.order-flow-workspace-mode .of-ws-table .of-order-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

#page-order-flow.order-flow-workspace-mode .of-ws-section-divider {
  height: 1px;
  margin: 0;
  background: #eef2f6;
}

#page-order-flow.order-flow-workspace-mode .of-ws-subhead {
  border-top: 0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-subrow td {
  background: #f9fafb;
  font-size: 12px;
  color: #475467;
}

#page-order-flow.order-flow-workspace-mode .of-ws-subrow-label {
  margin-right: 8px;
  color: #98a2b3;
  font-weight: 700;
}

#page-order-flow.order-flow-workspace-mode .of-ws-inline-warn {
  margin: 0 16px 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffaeb;
  color: #b54708;
  font-size: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-empty {
  padding: 24px 16px;
  color: #98a2b3;
  font-size: 13px;
  text-align: center;
}

#page-order-flow.order-flow-workspace-mode .of-ws-gap-list {
  padding: 12px 16px 16px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-overview-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#page-order-flow.order-flow-workspace-mode .of-ws-dev-details {
  margin: 0;
  padding: 12px 16px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-dev-details summary {
  cursor: pointer;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

#page-order-flow.order-flow-workspace-mode .of-ws-raw-json {
  margin-top: 10px;
  max-height: 360px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-hero-more {
  position: relative;
}

#page-order-flow.order-flow-workspace-mode .of-ws-hero-more > summary {
  list-style: none;
  cursor: pointer;
}

#page-order-flow.order-flow-workspace-mode .of-ws-hero-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  min-width: 140px;
  padding: 6px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(15 23 42 / .12);
}

#page-order-flow.order-flow-workspace-mode .of-ws-hero-more-menu button {
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

#page-order-flow.order-flow-workspace-mode .of-ws-hero-more-menu button:hover {
  background: #f2f6fb;
}

@media (max-width: 900px) {
  #page-order-flow.order-flow-workspace-mode .of-ws-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* 产品行可展开详情 */
#page-order-flow.order-flow-workspace-mode .of-ws-col-expand {
  width: 40px;
  padding-left: 12px !important;
  padding-right: 4px !important;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-btn:hover {
  border-color: #84adff;
  color: #175cd3;
  background: #f5f8ff;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-row.is-expanded .of-ws-expand-btn {
  border-color: #84adff;
  background: #eff4ff;
  color: #175cd3;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-row--hint .of-ws-expand-btn {
  border-color: #fedf89;
  background: #fffaeb;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-row > td {
  padding: 0 !important;
  border-top: 0;
  background: #f9fafb;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-panel {
  padding: 12px 16px 14px 52px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px 16px;
  margin: 0 0 10px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-meta > div {
  display: grid;
  gap: 2px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-meta dt {
  margin: 0;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 650;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-meta dd {
  margin: 0;
  color: #344054;
  font-size: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #eef2f6;
  font-size: 12px;
  color: #475467;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-note span {
  margin-right: 8px;
  color: #98a2b3;
  font-weight: 700;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-rules-head {
  margin: 0 0 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

#page-order-flow.order-flow-workspace-mode .of-ws-inspection-tree {
  display: grid;
  gap: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-process-route {
  margin: 0 0 4px;
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-stage-block {
  padding: 10px 12px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fff;
}

#page-order-flow.order-flow-workspace-mode .of-ws-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-stage-head strong {
  color: #101828;
  font-size: 13px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-stage-batches {
  margin-left: auto;
  color: #667085;
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-stage-gap,
#page-order-flow.order-flow-workspace-mode .of-ws-material-gap {
  margin: 0 0 8px;
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-material-block {
  padding: 8px 0 0;
  border-top: 1px dashed #eaecf0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-material-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-material-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-scope-badge {
  font-size: 10px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-avl-hint {
  color: #667085;
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-material-rules-link {
  margin-left: auto;
}

#page-order-flow.order-flow-workspace-mode .of-ws-batch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-batch-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 11px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-task-links {
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

#page-order-flow.order-flow-workspace-mode .of-ws-nested-table-wrap {
  padding: 0;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

#page-order-flow.order-flow-workspace-mode .of-ws-nested-table {
  margin: 0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-inline-warn--compact {
  margin: 0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-summary-inner {
  display: grid;
  gap: 10px;
  width: 100%;
}

#page-order-flow.order-flow-workspace-mode .of-ws-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-summary-head .of-ws-todos-toggle {
  margin-left: auto;
}

#page-order-flow.order-flow-workspace-mode .of-ws-todos-panel {
  padding-top: 4px;
  border-top: 1px solid #eef2f6;
}

#page-order-flow.order-flow-workspace-mode .of-ws-todos-panel .of-ws-gap-list {
  padding: 0;
}

#page-order-flow.order-flow-workspace-mode .of-ws-empty--compact {
  padding: 8px 0;
  text-align: left;
}

#page-order-flow.order-flow-workspace-mode .of-ws-expand-gaps {
  margin-bottom: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-gap-list--compact .of-tree-gap {
  padding: 8px 10px;
}

/* 任务单查询 · 订单维度 combobox 下拉 */
#page-task-query .tq-combo-field {
  display: grid;
  gap: 6px;
}

#page-task-query .tq-combo-wrap {
  position: relative;
  display: block;
}

#page-task-query .tq-combo-wrap > input {
  width: 100%;
  padding-right: 28px;
}

.qcos-field-clear-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.qcos-field-clear-wrap > input,
.qcos-field-clear-wrap > select {
  width: 100%;
  padding-right: 28px;
  box-sizing: border-box;
}

.entry-date-search .qcos-field-clear-wrap,
.mytask-search .qcos-field-clear-wrap,
.tq-search .qcos-field-clear-wrap,
.qt-search .qcos-field-clear-wrap,
.sidebar-tools-scan .qcos-field-clear-wrap,
.of-filter-search .qcos-field-clear-wrap,
.ped-query-strip .qcos-field-clear-wrap,
.prod-archive-toolbar .qcos-field-clear-wrap,
.fc-field-grow .qcos-field-clear-wrap,
.of-config-template-list .qcos-field-clear-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.qcos-field-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ai-muted, #94a3b8);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.qcos-field-clear:hover {
  background: rgb(148 163 184 / 0.16);
  color: var(--ai-text, #475569);
}

.qcos-field-clear.hidden {
  display: none;
}

#page-entry label .qcos-field-clear-wrap,
#page-entry .entry-search-panel label .qcos-field-clear-wrap {
  display: block;
  width: 100%;
}

#page-task-query .tq-input-clear-wrap,
#page-task-query .tq-select-clear-wrap {
  position: relative;
  display: block;
}

#page-task-query .tq-input-clear-wrap {
  flex: 1 1 220px;
  min-width: 0;
}

#page-task-query .tq-input-clear-wrap > input {
  width: 100%;
  padding-right: 28px;
}

#page-task-query .tq-select-clear-wrap > select {
  width: 100%;
  padding-right: 28px;
}

#page-task-query .tq-select-clear-field {
  display: grid;
  gap: 6px;
}

#page-task-query .tq-combo-wrap .qcos-field-clear {
  right: 8px;
}

#page-task-query .tq-combo-list {
  position: absolute;
  z-index: 24;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid rgb(226 232 240 / 0.95);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgb(15 43 92 / 0.12);
}

#page-task-query .tq-combo-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

#page-task-query .tq-combo-item strong {
  font-size: 12px;
  font-weight: 850;
  color: var(--ai-text, #0f172a);
}

#page-task-query .tq-combo-item small {
  font-size: 11px;
  color: var(--ai-muted, #64748b);
}

#page-task-query .tq-combo-item:hover,
#page-task-query .tq-combo-item:focus {
  background: rgb(37 99 235 / 0.08);
}

#page-task-query .tq-combo-item--empty {
  cursor: default;
  color: var(--ai-muted, #64748b);
  font-size: 12px;
}

#page-task-query .tq-order-filter-grid label input,
#page-task-query .tq-order-filter-grid label select {
  width: 100%;
}

#page-task-query .tq-advanced-filter-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 12px;
}

#page-task-query .tq-advanced-filter-title strong {
  font-size: 13px;
  font-weight: 900;
  color: var(--ai-text, #0f172a);
}

#page-task-query .tq-advanced-filter-title span {
  font-size: 12px;
  color: var(--ai-muted, #64748b);
}

#page-task-query .tq-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#page-task-query .tq-cascade {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px 6px;
  margin-top: 4px;
}

#page-task-query .tq-cascade-step {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

#page-task-query .tq-cascade-step.is-done {
  border-color: #bfdbfe;
  background: #f8fbff;
}

#page-task-query .tq-cascade-step.is-locked {
  opacity: 0.55;
  background: #f8fafc;
}

#page-task-query .tq-cascade-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

#page-task-query .tq-cascade-step-head em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

#page-task-query .tq-cascade-step.is-done .tq-cascade-step-head em {
  background: #2563eb;
  color: #fff;
}

#page-task-query .tq-cascade-step.is-locked .tq-cascade-step-head em {
  background: #e2e8f0;
  color: #94a3b8;
}

#page-task-query .tq-cascade-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 2px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
}

#page-task-query .tq-cascade-step .tq-combo-field,
#page-task-query .tq-cascade-step .tq-select-clear-field {
  display: block;
  margin: 0;
}

#page-task-query .tq-cascade-step input:disabled,
#page-task-query .tq-cascade-step select:disabled {
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
}

@media (max-width: 900px) {
  #page-task-query .tq-cascade-arrow {
    display: none;
  }

  #page-task-query .tq-cascade-step {
    flex: 1 1 100%;
  }
}

/* 订单工作台 · 产品列表 L1 / 产品跟单台 L2 */
#page-order-flow.order-flow-workspace-mode .of-ws-product-row--clickable {
  cursor: pointer;
}
#page-order-flow.order-flow-workspace-mode .of-ws-product-row--clickable:hover > td {
  background: #f8fafc;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d5dd;
  flex: 0 0 auto;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-dot--done { background: #12b76a; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-dot--active { background: #f79009; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-dot--pending { background: #2563eb; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-dot--no_task { background: #f04438; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-dot--no_rule {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #667085;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-desk {
  padding: 4px 4px 16px;
}
#page-order-flow.order-flow-workspace-mode .of-ws-desk-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 14px;
  border-bottom: 1px solid #eef2f6;
}
#page-order-flow.order-flow-workspace-mode .of-ws-desk-tab {
  position: relative;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#page-order-flow.order-flow-workspace-mode .of-ws-desk-tab.active {
  color: #2563eb;
}
#page-order-flow.order-flow-workspace-mode .of-ws-desk-tab.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #2563eb;
}
#page-order-flow.order-flow-workspace-mode .of-ws-product-desk-nav {
  margin-bottom: 10px;
}
#page-order-flow.order-flow-workspace-mode .of-ws-back-link {
  font-size: 13px;
  font-weight: 600;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.04);
}
#page-order-flow.order-flow-workspace-mode .of-ws-product-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f2f4f7, #e4e7ec);
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  flex: 0 0 auto;
}
#page-order-flow.order-flow-workspace-mode .of-ws-product-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
#page-order-flow.order-flow-workspace-mode .of-ws-product-card-title {
  color: #101828;
  font-size: 15px;
  font-weight: 700;
}
#page-order-flow.order-flow-workspace-mode .of-ws-product-card-meta {
  color: #667085;
  font-size: 12px;
}
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
}
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot--danger { color: #b42318; }
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot--danger i { background: #f04438; }
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot--warn { color: #b54708; }
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot--warn i { background: #f79009; }
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot--ok { color: #027a48; }
#page-order-flow.order-flow-workspace-mode .of-ws-status-dot--ok i { background: #12b76a; }
#page-order-flow.order-flow-workspace-mode .of-ws-product-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

#page-order-flow.order-flow-workspace-mode .of-ws-product-desk-section-head {
  margin: 14px 0 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-track {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-groups {
  display: grid;
  gap: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-group {
  padding: 12px 12px 0;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #f8fafc;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 9px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-group-head strong {
  color: #344054;
  font-size: 13px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-group-head span {
  color: #667085;
  font-size: 12px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-source {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff1f0;
  color: #b42318;
  font-size: 10px;
  font-weight: 600;
}

#page-order-flow.order-flow-workspace-mode .of-ws-lane-source.is-route {
  background: #eaf2ff;
  color: #175cd3;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 168px;
  max-width: 220px;
  flex: 1 1 168px;
  padding: 12px 14px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #fff;
  color: #344054;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

@media (max-width: 760px) {
  #page-order-flow.order-flow-workspace-mode .of-ws-lane-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card:hover {
  border-color: #b2ccff;
  background: #f8fafc;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb inset;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card-name {
  font-size: 13px;
  font-weight: 700;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--done .of-ws-lane-card-bar > span { background: #12b76a; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--active .of-ws-lane-card-bar > span,
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--pending .of-ws-lane-card-bar > span { background: #f79009; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--no_task .of-ws-lane-card-bar > span,
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--no_rule .of-ws-lane-card-bar > span { background: transparent; width: 0 !important; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #667085;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a2b3;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--done .of-ws-lane-card-status { color: #027a48; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--done .of-ws-lane-card-status i { background: #12b76a; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--active .of-ws-lane-card-status,
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--pending .of-ws-lane-card-status { color: #b54708; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--active .of-ws-lane-card-status i,
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--pending .of-ws-lane-card-status i { background: #f79009; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--no_task .of-ws-lane-card-status,
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--no_rule .of-ws-lane-card-status { color: #b42318; }
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--no_task .of-ws-lane-card-status i,
#page-order-flow.order-flow-workspace-mode .of-ws-lane-card--no_rule .of-ws-lane-card-status i { background: #f04438; }

#page-order-flow.order-flow-workspace-mode .of-ws-stage-desk {
  border: 1px solid #eef2f6;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
#page-order-flow.order-flow-workspace-mode .of-ws-stage-desk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
#page-order-flow.order-flow-workspace-mode .of-ws-stage-desk-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#page-order-flow.order-flow-workspace-mode .of-ws-stage-desk-title strong {
  font-size: 14px;
  color: #101828;
}
#page-order-flow.order-flow-workspace-mode .of-ws-lane-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 11px;
  font-weight: 600;
}
#page-order-flow.order-flow-workspace-mode .of-ws-stage-desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#page-order-flow.order-flow-workspace-mode .of-ws-task-empty {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 16px;
  border-radius: 10px;
  background: #fffaeb;
  border: 1px solid #fedf89;
}
#page-order-flow.order-flow-workspace-mode .of-ws-task-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
}
#page-order-flow.order-flow-workspace-mode .of-ws-task-empty-icon--warn {
  background: #fdb022;
  color: #fff;
}
#page-order-flow.order-flow-workspace-mode .of-ws-task-empty-body strong {
  display: block;
  margin-bottom: 4px;
  color: #93370d;
  font-size: 14px;
}
#page-order-flow.order-flow-workspace-mode .of-ws-task-empty-body p {
  margin: 0;
  color: #b54708;
  font-size: 12px;
  line-height: 1.5;
}
#page-order-flow.order-flow-workspace-mode .of-ws-desk-config {
  padding-top: 4px;
}
#page-order-flow.order-flow-workspace-mode .of-tree-gap-level {
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
}
#page-order-flow.order-flow-workspace-mode .of-tree-gap--error .of-tree-gap-level { color: #b42318; }
#page-order-flow.order-flow-workspace-mode .of-tree-gap--warn .of-tree-gap-level { color: #b54708; }
#page-order-flow.order-flow-workspace-mode .of-tree-gap--info .of-tree-gap-level { color: #344054; }

@media (max-width: 720px) {
  #page-order-flow.order-flow-workspace-mode .of-ws-product-card {
    align-items: flex-start;
  }
  #page-order-flow.order-flow-workspace-mode .of-ws-product-card-actions {
    margin-left: 0;
    width: 100%;
  }
  #page-order-flow.order-flow-workspace-mode .of-ws-lane-card {
    min-width: calc(50% - 5px);
    max-width: none;
  }
}


/* P1 · 物料快捷筛选条（替代 AI insight 扫码条） */
#page-products .prod-quick-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 14px;
}
#page-products .prod-quick-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
#page-products .prod-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* P1 · OQC 强制发货降为次级危险文字链 */
#page-oqc-sn .oqc-force-link {
  color: #b45309;
  border-color: transparent;
  background: transparent;
}
#page-oqc-sn .oqc-force-link:hover {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

/* P1 · 纯计数 KPI 中性灰（AI 复核中等非状态色） */
.ai-kpi-purple { --ai-kpi-color: #6b7280; --ai-kpi-bg: #f3f4f6; }
.ai-kpi-blue { --ai-kpi-color: #6b7280; --ai-kpi-bg: #f3f4f6; }
.mdmp-kpi-blue { --mdmp-kpi-color: #6b7280; --mdmp-kpi-bg: #f3f4f6; }
.sampling-kpi-blue { --sampling-kpi-color: #6b7280; --sampling-kpi-bg: #f3f4f6; }
.pcc-kpi-blue { --pcc-kpi-color: #6b7280; --pcc-kpi-bg: #f3f4f6; }
.ins-kpi-blue { --ins-kpi-color: #6b7280; --ins-kpi-bg: #f3f4f6; }
.msa-kpi-blue { --msa-kpi-color: #6b7280; --msa-kpi-bg: #f3f4f6; }
.fc-ledger-kpi-blue { --fc-kpi-color: #6b7280; --fc-kpi-bg: #f3f4f6; }


/* P2 · 免检清单页壳 */
#page-mdm-exemptions .ex-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#page-mdm-exemptions .ex-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
}
#page-mdm-exemptions .ex-hero h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}
#page-mdm-exemptions .ex-hero p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}
#page-mdm-exemptions .ex-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* P2 · 危险文字链（MSA 删除等） */
.qcos-op-link--danger {
  color: #9ca3af !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
.qcos-op-link--danger:hover {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  text-decoration: none;
}

/* 模块选择页：主区即导航，侧栏只留品牌；隐藏与页内重复的顶栏标题/模块切换 */
body.module-picker-mode .sidebar-nav,
body.module-picker-mode .sidebar-footer,
body.module-picker-mode .erp-main-chrome,
body.module-picker-mode .app-page-head,
body.module-picker-mode .qcos-module-switch,
body.module-picker-mode .qcos-global-context-sep {
  display: none !important;
}

body.module-picker-mode .sidebar {
  width: 88px;
  align-items: center;
}

body.module-picker-mode .sidebar-brand {
  width: 100%;
  justify-content: center;
  padding: 16px 8px;
  border-bottom: none;
  cursor: default;
}

body.module-picker-mode .brand-copy {
  display: none;
}

body.module-picker-mode .brand-mark {
  margin: 0;
}

@media (max-width: 900px) {
  body.module-picker-mode .sidebar {
    width: 100%;
    max-height: none;
    flex-direction: row;
    justify-content: flex-start;
    padding: 8px 12px;
  }
  body.module-picker-mode .sidebar-brand {
    width: auto;
    padding: 8px 4px;
  }
  body.module-picker-mode .brand-copy {
    display: flex;
  }
}

/* ===== 顶栏模块切换（业务域） ===== */
.qcos-module-switch {
  position: relative;
  flex-shrink: 0;
}

.qcos-module-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 9.5rem;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #1677ff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.qcos-module-switch-btn:hover,
.qcos-module-switch-btn[aria-expanded='true'] {
  background: #f0f7ff;
  border-color: rgb(22 119 255 / 0.22);
}

#qcos-module-switch-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qcos-module-switch-chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  flex-shrink: 0;
}

.qcos-module-switch-btn[aria-expanded='true'] .qcos-module-switch-chevron {
  transform: rotate(180deg);
}

.qcos-global-context-sep {
  width: 1px;
  height: 14px;
  background: #d9e2ec;
  flex-shrink: 0;
}

.qcos-module-switch-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 140;
  min-width: 200px;
  max-width: min(280px, 70vw);
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.12);
}

.qcos-module-switch-panel-head {
  padding: 6px 10px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.04em;
}

.qcos-module-switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.qcos-module-switch-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.qcos-module-switch-item strong {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}

.qcos-module-switch-item small {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.35;
  white-space: normal;
}

.qcos-module-switch-item > span {
  font-size: 11px;
  color: #9ca3af;
  flex-shrink: 0;
}

.sidebar-nav .nav-section.is-current-module > .nav-section-toggle {
  color: #1677ff;
}

.qcos-module-switch-item:hover {
  background: #f5f8fc;
}

.qcos-module-switch-item.is-active {
  background: #f0f7ff;
}

.qcos-module-switch-item.is-active strong {
  color: #1677ff;
}

.qcos-module-switch-item--all {
  margin-top: 4px;
  border-top: 1px dashed #eef0f3;
  border-radius: 0 0 6px 6px;
  justify-content: center;
  color: #1677ff;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-nav .nav-section.nav-module-hidden {
  display: none !important;
}

/* 当前模块：侧栏不再重复模块名折叠头，只留模块内菜单 */
.sidebar-nav .nav-section.is-current-module > .nav-section-toggle {
  display: none !important;
}

.sidebar-nav .nav-section.is-current-module > .nav-section-body {
  display: block !important;
  margin: 0;
  padding-top: 2px;
  border: none;
}

.sidebar-nav .nav-role-label {
  margin: 8px 0 2px;
  padding: 0 8px 0 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #9ca3af;
  text-transform: uppercase;
  user-select: none;
}

.sidebar-nav .nav-role-label.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .sidebar-nav .nav-role-label {
    flex-basis: 100%;
  }
}

body.layout-pro.sidebar-collapsed .nav-role-label {
  display: none !important;
}

/* 模块选择页 */
.module-home {
  max-width: 1080px;
  margin: 0 auto;
}

.module-home-head {
  margin: 6px 0 18px;
}

.module-home-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

.module-home-head p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.module-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.module-home-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.module-home-card:hover {
  border-color: rgb(22 119 255 / 0.45);
  box-shadow: 0 4px 14px rgb(22 119 255 / 0.12);
  transform: translateY(-1px);
}

.module-home-card.is-active {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgb(22 119 255 / 0.12);
}

.module-home-card-main h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
}

.module-home-card-main p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.module-home-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-home-chip {
  padding: 3px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  font-size: 11px;
  color: #4b5563;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.module-home-chip:hover {
  border-color: #1677ff;
  color: #1677ff;
  background: #f0f7ff;
}

.module-home-chip--more {
  cursor: default;
  color: #9ca3af;
}

.module-home-chip--more:hover {
  border-color: #e5e7eb;
  color: #9ca3af;
  background: #f9fafb;
}

.module-home-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed #eef0f3;
}

.module-home-count {
  font-size: 11px;
  color: #9ca3af;
}
