:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --text-main: #0f172a;
  --text-regular: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-dark: #94a3b8;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 全局布局 */
.erp-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 侧边导航栏 (高级莫兰迪冷岩灰·紧凑精炼版 172px) */
.sidebar {
  width: var(--sidebar-w, 172px);
  background: linear-gradient(180deg, #edf2f7 0%, #e2e8f0 100%);
  color: #1e293b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #cbd5e1;
  user-select: none;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2500; /* 永远高于任何弹窗遮罩，绝不受任何小窗口影响，始终可清晰点击 */
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: radial-gradient(circle at 50% 0%, rgba(191, 219, 254, 0.45) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.logo-box {
  padding: 12px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid #cbd5e1;
  position: relative;
  background: #edf2f7;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.logo-icon:hover {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.logo-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.logo-text h2 {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #0f172a;
  white-space: nowrap;
}

.logo-text span {
  font-size: 9.5px;
  color: #64748b;
  display: block;
  white-space: nowrap;
  letter-spacing: 0.1px;
  margin-top: 1px;
}

/* 侧边栏折叠按钮 */
.sidebar-collapse-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar-collapse-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
  transform: scale(1.05);
}

.sidebar-collapse-btn .icon {
  width: 13px;
  height: 13px;
}

.nav-menu {
  flex: 1;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.nav-item .icon {
  width: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  opacity: 0.95;
  flex-shrink: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.nav-item .nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

/* 悬停态：深一阶冷灰对比 */
.nav-item:hover {
  background: #d8e2ed;
  color: #0f172a;
  border-color: #cbd5e1;
  transform: translateX(1px);
}

.nav-item:hover .icon {
  color: #2563eb;
  background: #ffffff;
  border-color: #93c5fd;
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* 激活选中态：立体浮岛纯白卡片，脱颖而出 */
.nav-item.active {
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
  font-weight: 600;
  transform: translateX(0);
}

/* 左侧高亮指示条 */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5px;
  height: 18px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.45);
}

.nav-item.active .icon {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.18);
  opacity: 1;
}

/* 极简折叠模式下的展开按钮与底部 */
.sidebar-mini-footer {
  display: none;
}

.sidebar-mini-expand-btn {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sidebar-mini-expand-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
  transform: scale(1.08);
}

.sidebar-mini-expand-btn .icon {
  width: 20px;
  height: 20px;
}

/* ================= 极简模式 (Collapsed Mini Sidebar) ================= */
.sidebar.collapsed {
  width: 64px;
  overflow: visible;
  background: #f1f5f9;
}

.sidebar.collapsed .logo-box {
  padding: 16px 8px;
  justify-content: center;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-collapse-btn,
.sidebar.collapsed .sidebar-footer {
  display: none !important;
}

.sidebar.collapsed .sidebar-mini-footer {
  display: flex;
  justify-content: center;
  padding: 14px 0;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
}

.nav-item .nav-short {
  display: none;
}

.sidebar.collapsed .nav-menu {
  overflow: visible;
  padding: 12px 6px;
  gap: 6px;
  align-items: center;
}

.sidebar.collapsed .nav-item {
  width: 48px;
  height: 52px;
  padding: 5px 0 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  gap: 3px;
}

.sidebar.collapsed .nav-item .nav-text {
  display: none !important;
}

.sidebar.collapsed .nav-item .icon {
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  margin: 0;
  opacity: 0.9;
}

.sidebar.collapsed .nav-item.active .icon {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #1d4ed8;
  filter: none;
}

.sidebar.collapsed .nav-item .nav-short {
  display: block !important;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0;
  user-select: none;
  text-shadow: none;
}

.sidebar.collapsed .nav-item:hover .nav-short {
  color: #0f172a;
}

.sidebar.collapsed .nav-item.active .icon {
  opacity: 1;
}

.sidebar.collapsed .nav-item.active .nav-short {
  color: #1d4ed8;
}

/* 极简模式悬停浮动气泡提示 (Tooltip) */
.sidebar.collapsed .nav-item::before {
  content: '';
  position: absolute;
  left: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #0f172a;
  opacity: 0;
  visibility: hidden;
  z-index: 9999;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.sidebar.collapsed .nav-item::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid #1e293b;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar.collapsed .nav-item:hover::before,
.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
  visibility: visible;
}

.sidebar-footer {
  padding: 8px 6px;
  border-top: 1px solid #cbd5e1;
  background: #dbe3ed;
  position: relative;
  z-index: 1;
}

.shortcut-tip {
  font-size: 10px;
  color: #64748b;
  line-height: 1.5;
  padding: 1px 2px;
}

.shortcut-tip span {
  color: #334155;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
  font-size: 9.5px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.shortcut-tip div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 10px;
}

kbd {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 #ffffff;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 600;
  color: #1e40af;
  font-family: var(--font-mono);
}

/* 主内容区 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-app);
}

.top-header {
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}

.header-sidebar-toggle-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.header-sidebar-toggle-btn .icon {
  width: 19px;
  height: 19px;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

/* 顶部查看单据日期切换胶囊栏 */
.header-date-view-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
}

.header-date-view-group:hover {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.header-date-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  user-select: none;
}

.header-date-input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12.5px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.15s;
}

.header-date-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}


.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-app);
  color: var(--text-regular);
}

.badge-success {
  background: var(--success-light);
  color: var(--success-hover);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==================== 字体大小动态调节（适老与大字模式） ==================== */
.font-scale-control {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  gap: 2px;
}

.font-scale-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-right: 2px;
  user-select: none;
}

.font-scale-btn {
  border: none;
  background: transparent;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  color: #334155;
  cursor: pointer;
  transition: all 0.16s ease;
  line-height: 1.2;
}

.font-scale-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.font-scale-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
  font-weight: 700;
}

/* 1. 大字清晰模式 (115% 缩放) */
body.font-scale-large {
  font-size: 15px;
}

body.font-scale-large .excel-grid-table th {
  font-size: 14.5px !important;
}

body.font-scale-large .excel-cell-input,
body.font-scale-large .excel-cell-seq {
  font-size: 15.5px !important;
  font-weight: 600 !important;
}

body.font-scale-large .input-goods-price,
body.font-scale-large .input-goods-qty,
body.font-scale-large .excel-cell-number {
  font-size: 16.5px !important;
  font-weight: 700 !important;
}

body.font-scale-large .form-header-grid input,
body.font-scale-large .form-header-grid label,
body.font-scale-large .form-header-grid select {
  font-size: 14.5px !important;
}

body.font-scale-large .form-header-grid label {
  font-weight: 700 !important;
}

body.font-scale-large .browser-tab {
  font-size: 14px !important;
  padding: 7px 15px !important;
}

body.font-scale-large .browser-tab .tab-title {
  font-size: 14px !important;
  font-weight: 700 !important;
}

body.font-scale-large .chinese-amount-preview,
body.font-scale-large .order-summary-box {
  font-size: 16.5px !important;
  font-weight: 700 !important;
}

body.font-scale-large .sidebar.collapsed .nav-item .nav-short {
  font-size: 14.5px !important;
  font-weight: 900 !important;
}

body.font-scale-large .nav-item {
  font-size: 15.5px !important;
}

/* 2. 长辈特大模式 (130% 极大清晰加粗) */
body.font-scale-huge {
  font-size: 16.5px;
}

body.font-scale-huge .excel-grid-table th {
  font-size: 16px !important;
  font-weight: 800 !important;
}

body.font-scale-huge .excel-cell-input,
body.font-scale-huge .excel-cell-seq {
  font-size: 17.5px !important;
  font-weight: 700 !important;
}

body.font-scale-huge .input-goods-price,
body.font-scale-huge .input-goods-qty,
body.font-scale-huge .excel-cell-number {
  font-size: 19px !important;
  font-weight: 800 !important;
}

body.font-scale-huge .form-header-grid input,
body.font-scale-huge .form-header-grid label,
body.font-scale-huge .form-header-grid select {
  font-size: 16px !important;
}

body.font-scale-huge .form-header-grid input {
  height: 42px !important;
  font-weight: 700 !important;
}

body.font-scale-huge .form-header-grid label {
  font-weight: 800 !important;
}

body.font-scale-huge .browser-tab {
  font-size: 15.5px !important;
  padding: 9px 18px !important;
}

body.font-scale-huge .browser-tab .tab-title {
  font-size: 15.5px !important;
  font-weight: 800 !important;
}

body.font-scale-huge .chinese-amount-preview,
body.font-scale-huge .order-summary-box {
  font-size: 19px !important;
  font-weight: 800 !important;
}

body.font-scale-huge .sidebar.collapsed .nav-item .nav-short {
  font-size: 16px !important;
  font-weight: 900 !important;
}

body.font-scale-huge .nav-item {
  font-size: 17px !important;
}

body.font-scale-huge .excel-toolbar-right button,
body.font-scale-huge .quick-history-bar button {
  font-size: 14px !important;
  font-weight: 700 !important;
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* 标签页隐藏与显示 */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片与网格通用 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.order-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 头部表单布局：客户名称、送货人、日期与单号一行平铺整洁对齐 */
.form-header-grid {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-light);
  width: 100%;
}

.form-group-customer {
  flex: 1;
  min-width: 280px;
  max-width: 440px;
  margin-bottom: 0;
}

.form-group-handler {
  width: 160px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.form-header-right-meta {
  margin-left: auto; /* 关键：自动靠右对齐，更显整洁规范 */
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-shrink: 0;
}

.form-group-date {
  width: 165px;
}

.form-group-orderno {
  width: 235px;
}

@media (max-width: 1150px) {
  .form-header-grid {
    flex-wrap: wrap;
    gap: 14px;
  }
  .form-header-right-meta {
    margin-left: 0;
  }
}


.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-regular);
}

.form-group label .required {
  color: var(--danger);
}

.form-group input, 
.form-group select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.highlight-group input {
  background: #f8fbff;
  border-color: #93c5fd;
  font-weight: 500;
}

.field-hint {
  font-size: 11.5px;
  color: var(--primary);
  margin-top: 2px;
}

.input-action-wrap {
  display: flex;
  gap: 4px;
}

.input-action-wrap input {
  flex: 1;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* 智能联想下拉列表 */
.input-with-suggest {
  position: relative;
}

.suggest-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.suggest-item {
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.suggest-item:hover, .suggest-item.active {
  background: #eff6ff;
  color: var(--primary);
}

.suggest-item .tag {
  font-size: 11px;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* 表格工具条 */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.table-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.table-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 开关 Toggle */
.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: var(--border-medium);
  border-radius: 20px;
  position: relative;
  transition: 0.2s;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-control input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-control input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

/* ===== 纯正 Excel 电子表格工作台体系 ===== */
.excel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #f8fafc;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

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

.excel-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 13px;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.excel-meta-chip .meta-chip-icon {
  font-size: 13px;
}

.excel-meta-chip.chip-customer {
  font-weight: 700;
  color: #1e3a8a;
  background: #f0f7ff;
  border-color: #bfdbfe;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-meta-chip.chip-customer .meta-chip-customer.is-empty {
  color: #94a3b8;
  font-weight: 500;
}

.excel-meta-chip.chip-date {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #334155;
  background: #ffffff;
}

.excel-meta-chip.chip-scheme {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
  font-weight: 600;
}

.meta-chip-scheme-select {
  border: 1px solid #86efac;
  background: #ffffff;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.meta-chip-scheme-select:hover,
.meta-chip-scheme-select:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.excel-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.excel-tool-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.excel-tool-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.excel-tool-btn.text-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.excel-tool-btn.excel-tool-nav {
  font-weight: 600;
  color: #2563eb;
  border-color: #93c5fd;
  background: #f0f7ff;
}

.excel-tool-btn.excel-tool-nav:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}

/* 核心 Excel 表格画布容器 */
.excel-grid-viewport {
  overflow-x: auto;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.excel-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
  background: #ffffff;
  table-layout: auto;
}

/* Excel 风格表头 */
.excel-header-row th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  padding: 7px 8px;
  border: 1px solid #cbd5e1;
  border-top: none;
  white-space: nowrap;
  user-select: none;
  font-size: 13px;
  text-align: center;
}

.excel-th-seq {
  background: #e5e7eb !important;
  color: #4b5563 !important;
  text-align: center !important;
}

/* 生产日期与保质期列：默认全局隐藏，开启时强制展示 */
.col-mfg-date,
.col-shelf-life {
  display: none;
}

#order-items-table.show-mfg-date .col-mfg-date,
#order-items-table.show-mfg-date .col-shelf-life,
.show-mfg-date .col-mfg-date,
.show-mfg-date .col-shelf-life {
  display: table-cell !important;
}

/* 历史售价列样式 */
.excel-th.col-history-price {
  background: #f8fafc;
  color: #4338ca;
  font-weight: 600;
}

.excel-cell.col-history-price {
  background: #ffffff;
  vertical-align: middle;
  padding: 2px 4px;
}

.cell-history-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cell-history-badge:hover {
  background: #4338ca;
  color: #ffffff;
  border-color: #3730a3;
  box-shadow: 0 1px 4px rgba(67, 56, 202, 0.35);
  transform: translateY(-1px);
}

.cell-history-badge.is-diff {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.cell-history-badge.is-diff:hover {
  background: #d97706;
  color: #ffffff;
  border-color: #b45309;
}

/* 单元格与输入框：无缝紧密贴合 */
.excel-grid-table td {
  border: 1px solid #d1d5db;
  padding: 0;
  margin: 0;
  height: 34px;
  position: relative;
  background: #ffffff;
  vertical-align: middle;
  text-align: center;
}

.excel-grid-table tr:hover td {
  background-color: #f9fafb;
}

/* 行号列：支持点击与滑动多选整行 */
.excel-cell-seq {
  background: #f8fafc;
  color: #64748b;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  -webkit-user-select: none;
  width: 45px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.excel-cell-seq:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.excel-th-seq {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.excel-th-seq:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* 行号选中与整行选中激活状态：原生 Excel 质感高亮与经典翠绿边界指示 */
.excel-cell-seq.seq-selected {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  font-weight: 700 !important;
  border-right: 3px solid #107c41 !important;
}

.excel-cell-seq.seq-active-row {
  background-color: #f1f5f9;
  color: #0f172a;
  border-right: 2px solid #94a3b8;
}

/* 整行选中高亮背景 */
.excel-grid-row.row-selected > td {
  background-color: rgba(16, 124, 65, 0.12) !important;
}

.excel-grid-row.row-selected > td.col-total {
  background-color: rgba(16, 124, 65, 0.12) !important;
}

/* 单元格内的输入框：全部内容水平垂直居中 */
.excel-cell-input {
  width: 100%;
  height: 100%;
  min-height: 34px;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: 4px 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: #111827;
  box-sizing: border-box;
  text-align: center !important;
}

.excel-cell-input::placeholder {
  text-align: center;
}

.excel-cell-input.num-input {
  font-family: var(--font-mono);
  text-align: center !important;
  font-weight: 600;
}

.excel-cell-input.text-center {
  text-align: center !important;
}

/* 隐藏浏览器原生数字增减微调箭头，还原纯净 Excel 单元格 */
.excel-cell-input::-webkit-outer-spin-button,
.excel-cell-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.excel-cell-input[type=number] {
  -moz-appearance: textfield;
}

/* 经典 Excel 绿色选中激活框效果！仅在非锁定状态下支持 cell-active 与 focus-within */
/* 经典 Excel 绿色选中激活框效果：无论编辑还是已保存查看状态，均支持 cell-active 与 focus-within */
.excel-grid-table td.cell-active,
.excel-grid-table td:focus-within {
  outline: 2px solid #107c41 !important;
  outline-offset: -1px;
  z-index: 10;
  background-color: #ffffff !important;
}

/* 原伪元素抓手改由动态交互式 DOM #excel-fill-handle 代替，支持真实鼠标拖拽下拉填充与双击智能填充 */
.excel-grid-table td.cell-active::after,
.excel-grid-table td:focus-within::after,
.excel-grid-table td.cell-selected-corner::after {
  display: none !important;
}

/* 交互式 Excel 右下角下拉填充柄 (AutoFill Handle) */
#excel-fill-handle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #107c41;
  border: 1px solid #ffffff;
  cursor: crosshair;
  z-index: 1000;
  display: none;
  box-sizing: border-box;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
  touch-action: none;
  user-select: none;
}

#excel-fill-handle:hover {
  transform: scale(1.4);
  background: #0d5f32;
}

/* 填充预览高亮虚线框与半透明绿底 */
.excel-grid-table td.cell-fill-target {
  background-color: rgba(16, 124, 65, 0.16) !important;
  outline: 2px dashed #107c41 !important;
  outline-offset: -2px;
}

/* 已保存/查看状态下：防止误打字更改，但全面支持鼠标选中、拖动框选、Ctrl+C 复制与下拉填充复制 */
.order-locked-table td.excel-cell {
  cursor: cell !important;
}

.order-locked-table td.excel-cell .excel-cell-input {
  cursor: cell !important;
  caret-color: transparent !important;
  pointer-events: auto !important;
  user-select: all !important;
  background-color: transparent;
}

/* 单元格在未编辑状态下：单击是选中，鼠标呈现十字光标，禁止默认点进输入框光标 */
.excel-grid-table td.excel-cell {
  position: relative;
  cursor: cell;
  user-select: none;
}

.excel-grid-table td.excel-cell:focus {
  outline: 2px solid #107c41 !important;
  outline-offset: -1px;
}

/* 单元格在未编辑状态下：单击是选中，鼠标呈现十字光标，光标透明无插入条，保持输入法就绪 */
.excel-grid-table td.excel-cell:not(.cell-editing) .excel-cell-input {
  cursor: cell;
  caret-color: transparent !important;
  user-select: all;
}

.excel-grid-table td.excel-cell:not(.cell-editing) .excel-cell-input::selection {
  background-color: rgba(16, 124, 65, 0.16) !important;
  color: inherit !important;
}

/* 双击进入编辑模式：光标点进去算输入 */
.excel-grid-table td.excel-cell.cell-editing {
  cursor: text;
  background-color: #ffffff !important;
}

.excel-grid-table td.excel-cell.cell-editing .excel-cell-input {
  cursor: text !important;
  user-select: text !important;
  caret-color: #111827 !important;
}

.excel-grid-table td.excel-cell.cell-editing .excel-cell-input::selection {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
}




/* Excel 多选区域（选区）高亮样式 */
.excel-grid-table.selecting {
  user-select: none;
}

.excel-grid-table td.cell-selected {
  background-color: rgba(16, 124, 65, 0.15) !important;
}

.excel-grid-table td.cell-selected-top {
  border-top: 2px solid #107c41 !important;
}
.excel-grid-table td.cell-selected-bottom {
  border-bottom: 2px solid #107c41 !important;
}
.excel-grid-table td.cell-selected-left {
  border-left: 2px solid #107c41 !important;
}
.excel-grid-table td.cell-selected-right {
  border-right: 2px solid #107c41 !important;
}

.excel-grid-table td.cell-selected-corner::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 6px;
  height: 6px;
  background: #107c41;
  pointer-events: none;
  z-index: 20;
}

/* 金额计算单元格：居中显示 */
.excel-cell-total {
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center !important;
  padding: 4px 10px;
  color: #1e293b;
  user-select: none;
}

/* 操作列删除按钮 */
.excel-cell-action {
  text-align: center;
}

.excel-row-del-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 3px;
  transition: 0.15s;
}

.excel-row-del-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* ⚠️ 导入特殊颜色标记：报价无名字、无单位或未填单价的高亮提示 */
tr.excel-grid-row.row-has-warning {
  background-color: #fffbeb !important;
}

tr.excel-grid-row.row-has-warning td {
  background-color: #fffbeb !important;
}

tr.excel-grid-row.row-has-warning td.row-seq {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
  font-weight: 700 !important;
  border-left: 3.5px solid #f59e0b !important;
}

/* 报价没有名字（未匹配商品）或没有单位的输入框特殊颜色 */
.excel-cell-input.cell-warn-unquoted {
  background-color: #fef3c7 !important;
  border: 1.5px solid #f59e0b !important;
  color: #b45309 !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  box-shadow: 0 0 0 1.5px rgba(245, 158, 11, 0.25) !important;
  animation: warnPulseAmber 2s infinite ease-in-out;
}

.excel-cell-input.cell-warn-unquoted:focus {
  background-color: #ffffff !important;
  border-color: #d97706 !important;
  box-shadow: 0 0 0 2.5px rgba(217, 119, 6, 0.35) !important;
  color: #0f172a !important;
}

/* 报价无单价或未填单价的特殊颜色 */
.excel-cell-input.cell-warn-price {
  background-color: #fee2e2 !important;
  border: 1.5px solid #ef4444 !important;
  color: #b91c1c !important;
  font-weight: 800 !important;
  border-radius: 4px !important;
  box-shadow: 0 0 0 1.5px rgba(239, 68, 68, 0.25) !important;
  animation: warnPulseRed 2s infinite ease-in-out;
}

.excel-cell-input.cell-warn-price:focus {
  background-color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2.5px rgba(220, 38, 38, 0.35) !important;
  color: #0f172a !important;
}

@keyframes warnPulseAmber {
  0%, 100% {
    background-color: #fef3c7;
    border-color: #f59e0b;
  }
  50% {
    background-color: #fde68a;
    border-color: #d97706;
  }
}

@keyframes warnPulseRed {
  0%, 100% {
    background-color: #fee2e2;
    border-color: #ef4444;
  }
  50% {
    background-color: #fecaca;
    border-color: #dc2626;
  }
}

/* Excel 风格右键上下文菜单 */
.excel-context-menu {
  position: fixed;
  z-index: 999999;
  min-width: 205px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.22), 0 8px 10px -6px rgba(15, 23, 42, 0.12);
  padding: 5px;
  display: flex;
  flex-direction: column;
  user-select: none;
  animation: contextMenuPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

@keyframes contextMenuPop {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.excel-menu-item {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  line-height: 1;
}

.excel-menu-item:hover {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.excel-menu-item.highlight-action {
  color: #1d4ed8;
  font-weight: 600;
}

.excel-menu-item.highlight-action:hover {
  background-color: #dbeafe;
  color: #1e40af;
}

.excel-menu-item.danger:hover {
  background-color: #fee2e2;
  color: #b91c1c;
}

.excel-menu-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.excel-menu-icon {
  font-size: 14px;
  width: 20px;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.excel-menu-text {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
}

.excel-menu-shortcut {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: #64748b;
  margin-left: 14px;
  font-weight: 600;
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.excel-menu-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 4px 2px;
}

/* Excel 底部合计汇总栏 (tfoot) */
.excel-tfoot-row td {
  background: #f8fafc !important;
  border-top: 2px solid #4b5563 !important;
  border-bottom: 3px double #111827 !important;
  padding: 8px 10px !important;
  font-size: 13.5px;
}

.excel-total-label {
  color: #1f2937;
  padding-left: 12px !important;
}

.chinese-amount-text {
  color: #b45309;
  font-weight: 700;
  font-size: 14.5px;
  margin-left: 6px;
}

.excel-cell-number {
  font-family: var(--font-mono);
  text-align: center !important;
  padding: 0 10px !important;
}

.excel-cell-center {
  text-align: center;
}

.font-bold {
  font-weight: 700;
}

.font-large {
  font-size: 16px !important;
}

.text-success {
  color: #107c41 !important;
}

.excel-total-meta {
  color: #64748b;
  font-size: 12.5px;
  text-align: center;
  padding: 0 12px !important;
}

/* 单元格自动联想下拉浮层 */
.cell-suggest-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.cell-goods-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  width: 320px;
  background: #ffffff;
  border: 1px solid #107c41;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

/* 底部结算面板 */
.order-summary-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  gap: 20px;
}

.summary-left {
  flex: 1;
  max-width: 500px;
}

.price-notice-banner {
  margin-top: 8px;
  font-size: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.summary-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.stat-item {
  font-size: 14px;
  color: var(--text-regular);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  margin-left: 8px;
}

.total-highlight {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.text-primary {
  color: var(--primary) !important;
  font-size: 24px !important;
}

.stat-chinese-amount {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-chinese-amount span {
  color: #b45309;
  font-weight: 600;
}

/* 按钮风格 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background: #475569;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #334155;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: var(--success-hover);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-medium);
  color: var(--text-regular);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--border-dark);
}

.btn-outline-danger {
  background: #ffffff;
  border-color: #fca5a5;
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-light);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 15px;
}

.form-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* 历史列表查询与筛选卡片 */
.filter-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

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

.table-card {
  padding: 0;
  overflow: hidden;
}

/* ===== 各单位报价表全新布局：顶上是单位名，展开显示表格 ===== */
.quotation-view-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quotation-top-bar {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quotation-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.quotation-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.quotation-search-box input {
  width: 280px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.quotation-search-box input:focus {
  border-color: var(--primary);
}

/* 顶上的单位卡片/标签栏 */
.quotation-customer-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.customer-tab-card {
  flex: 0 0 auto;
  min-width: 180px;
  max-width: 240px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}

.customer-tab-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.customer-tab-card.active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.customer-tab-card.active::after {
  content: "▼ 展开中";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  padding: 0 6px;
  border-radius: 10px;
  font-weight: bold;
}

.tab-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-tab-card.active .tab-card-title {
  color: #2563eb;
}

.tab-card-subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
}

/* 点开下面显示的商品报价详情面板 */
.quotation-detail-panel {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.quotation-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}

.curr-customer-info h2 {
  font-size: 17px;
  font-weight: 700;
  display: inline-block;
  margin-right: 8px;
}

.quotation-detail-actions {
  display: flex;
  gap: 8px;
}

.quotation-tip-bar {
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

/* 报价表中的可编辑输入框 */
.cell-editable-input {
  width: 100%;
  height: 100%;
  min-height: 32px;
  border: none;
  background: transparent;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.cell-editable-input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px #2563eb;
}

/* 打印模板设计器界面 */
.template-designer-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 22px;
  align-items: flex-start;
}

@media (max-width: 1280px) {
  .template-designer-layout {
    grid-template-columns: 420px 1fr;
    gap: 16px;
  }
}

.designer-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  box-sizing: border-box;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
}

.designer-controls::-webkit-scrollbar {
  width: 6px;
}

.designer-controls::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.designer-controls::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.designer-controls::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.designer-controls .form-group {
  min-width: 0;
  width: 100%;
}

.designer-controls .form-group select,
.designer-controls .form-group input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 14px;
}

.control-group h4 {
  font-size: 13.5px;
  color: var(--text-main);
  font-weight: 700;
}

.form-row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.form-row-2-equal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
}

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

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

/* 打印单列位置与宽度自定义列表 */
.columns-manager-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  max-height: 520px;
  overflow-y: auto;
}

.column-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  cursor: grab;
  position: relative;
}

.column-item-row:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.12);
}

.column-item-row:active {
  cursor: grabbing;
}

.column-item-row input,
.column-item-row label {
  cursor: default;
  user-select: auto;
}

.col-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  cursor: grab;
  cursor: -webkit-grab;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.col-drag-handle:hover {
  background: #dbeafe;
  color: #2563eb;
  border-color: #93c5fd;
  transform: scale(1.06);
}

.col-drag-handle:active,
.column-item-row.is-dragging .col-drag-handle {
  cursor: grabbing;
  cursor: -webkit-grabbing;
  background: #bfdbfe;
  color: #1d4ed8;
}

.column-item-row.is-dragging {
  opacity: 0.35;
  background: #eff6ff !important;
  border: 1.5px dashed #2563eb !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transform: scale(0.98);
}

.column-item-row.drag-over-top {
  border-top: 3px solid #2563eb !important;
  background: #f0fdf4;
}

.column-item-row.drag-over-bottom {
  border-bottom: 3px solid #2563eb !important;
  background: #f0fdf4;
}

.col-visible-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.col-name-input {
  width: 90px;
  height: 26px;
  padding: 2px 6px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.col-width-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
  flex-shrink: 0;
}

.col-width-input {
  width: 50px;
  height: 26px;
  padding: 2px 4px;
  font-size: 12px;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-weight: 600;
  color: #0f172a;
}

.designer-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 130px);
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-weight: 600;
  flex-shrink: 0;
}

.preview-paper-stage {
  background: #cbd5e1;
  padding: 24px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  min-height: 480px;
  max-height: calc(100vh - 215px);
  overflow: auto;
}

/* 打印纸张实体模拟 */
.print-sheet {
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
  padding: 20px 24px;
  color: #000;
  font-family: 'Noto Sans SC', SimHei, sans-serif;
  transition: all 0.2s ease;
}

/* 纸张规格大小模拟 */
.print-sheet.paper-241-2 {
  width: 760px;
  min-height: 480px;
}

.print-sheet.paper-241-3 {
  width: 760px;
  min-height: 340px;
}

.print-sheet.paper-a4 {
  width: 720px;
  min-height: 1000px;
}

.print-sheet.paper-a5-landscape {
  width: 780px;
  min-height: 520px;
}

/* 打印单内联样式（精确匹配针式销售单排版） */
.ps-header {
  text-align: center;
  margin-bottom: 6px;
  position: relative;
}

.ps-main-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #000;
  font-family: "SimSun", "Songti SC", "STSong", "SimHei", "Microsoft YaHei", serif;
  margin: 0;
  padding: 0;
}

.ps-meta-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
  font-size: 13.5px;
  color: #000;
  font-weight: 500;
  font-family: "SimSun", "Songti SC", "STSong", "SimHei", "Microsoft YaHei", sans-serif;
}

.ps-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.5;
}

.ps-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  border: 1px solid #000;
  table-layout: fixed;
}

.ps-table th, .ps-table td {
  border: 1px solid #000;
  padding: 5px 6px;
  font-size: 13px;
  color: #000;
  line-height: 1.4;
}

/* 打印模板固定行数：补齐空白行的规范高度与无文字状态 */
.ps-empty-row td {
  height: 27px;
  min-height: 27px;
  line-height: 27px;
  padding: 0 6px;
}

/* 打印表格线框风格 */
.border-solid .ps-table,
.border-solid .ps-table th,
.border-solid .ps-table td {
  border: 1px solid #000;
}

.border-double .ps-table {
  border: 3px double #000;
}
.border-double .ps-table th,
.border-double .ps-table td {
  border: 1px solid #000;
}

.border-minimal .ps-table th {
  border-bottom: 2px solid #000;
  border-top: 2px solid #000;
}
.border-minimal .ps-table td {
  border-bottom: 1px solid #999;
}

.ps-table th {
  background: transparent;
  font-weight: bold;
  text-align: center;
}

.ps-total-row {
  font-weight: bold;
}

.ps-sign-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 24px 0 24px;
  font-size: 14px;
  color: #000;
  font-family: "SimSun", "Songti SC", "STSong", "SimHei", "Microsoft YaHei", sans-serif;
}

.ps-sign-item {
  font-weight: 500;
}

/* 档案中心界面 */
.archive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.archive-header h3 {
  font-size: 16px;
  font-weight: 700;
}

/* 弹窗样式 (限制在主工作区，绝不遮挡或影响左侧导航栏) */
:root {
  --sidebar-w: 172px;
}

body.sidebar-collapsed {
  --sidebar-w: 64px;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-w, 172px); /* 弹窗遮罩只限制在右侧工作区内，绝不延伸覆盖左侧导航栏！ */
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

body.sidebar-collapsed .modal-backdrop {
  left: 64px;
}

.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1001;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-minimize {
  display: none !important;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.modal-close:hover {
  color: #ef4444;
}

/* 右下角弹窗后台挂起/最小化浮动任务栏 (Dock Bar) - 隐藏，改为页面原生记忆恢复机制 */
.modal-dock-bar {
  display: none !important;
}
  gap: 8px;
  pointer-events: auto;
}

.dock-item {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  animation: dockPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dock-item:hover {
  transform: translateY(-2px);
  background: #1e293b;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(56, 189, 248, 0.35);
}

.dock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseDot 1.8s infinite ease-in-out;
}

.dock-title {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.dock-btn-restore {
  background: #2563eb;
  border: 1px solid #60a5fa;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dock-btn-restore:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.dock-btn-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  border-radius: 4px;
}

.dock-btn-close:hover {
  color: #f87171;
}

@keyframes dockPop {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* 工具样式 */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }

/* 侧边栏 JSON 存储面板 (紧凑质感) */
.json-storage-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 7px;
  margin-bottom: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.json-storage-panel:hover {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.json-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.json-actions {
  display: flex;
  gap: 4px;
}

.json-btn {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.json-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  transform: translateY(-1px);
}

/* ========================================================
   3. 各单位报价表：顶部单位名标签卡片 + 下方商品/单位/价格/换算表格
   ======================================================== */
.quotation-view-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 顶部单位卡片选择区 */
.quotation-top-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.quotation-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.quotation-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.quotation-search-box input {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 240px;
  background: #ffffff;
  transition: all 0.2s;
}

.quotation-search-box input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 顶上单位卡片流式网格/横排列表 */
.quotation-customer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 160px;
  overflow-y: auto;
  padding-bottom: 4px;
}

.customer-tab-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 170px;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.customer-tab-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
}

/* 当前选中的激活单位卡片 */
.customer-tab-card.active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 4px 8px rgba(37, 99, 235, 0.12);
}

.customer-tab-card.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #2563eb;
  border-radius: 8px 8px 0 0;
}

.tab-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-tab-card.active .tab-card-title {
  color: #1d4ed8;
}

.tab-card-subtitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #64748b;
  font-family: var(--font-mono);
}

/* 点开下面显示的商品/单位/价格/换算面板 */
.quotation-detail-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quotation-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 12px;
}

.curr-customer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.curr-customer-info h2 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.quotation-detail-actions {
  display: flex;
  gap: 8px;
}

.quotation-tip-bar {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 12px;
}

/* 报价表格可编辑单元格悬浮与焦点效果 */
#quotation-grid-table td:focus-within {
  outline: 2px solid #2563eb !important;
  background-color: #ffffff !important;
}

#quotation-grid-table input:focus {
  background: #ffffff !important;
}

.btn-del-quotation-row {
  color: #94a3b8;
  border-color: #e2e8f0;
}

.btn-del-quotation-row:hover {
  background-color: #fef2f2 !important;
  color: #ef4444 !important;
  border-color: #fca5a5 !important;
}

.quotation-table-bottom-bar {
  padding: 8px 4px;
}

/* 弹窗与通用数据表格样式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #ffffff;
}

.data-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1.5px solid #cbd5e1;
  white-space: nowrap;
  user-select: none;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

/* 弹窗选择器高亮与交互样式 */
.selected-picker-row td {
  background-color: #eff6ff !important;
}
.selected-picker-row {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 600;
}
.picker-row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.picker-row:hover td {
  background-color: #f1f5f9 !important;
}

/* ========================================================
   开单界面：按日期快速联查当日全部出库单并在旁边选择
   ======================================================== */
.quick-history-bar {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.qhb-date-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qhb-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.qhb-date-input {
  padding: 5px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  font-family: inherit;
  color: #0f172a;
  font-weight: 600;
}

.qhb-date-input:focus {
  border-color: #2563eb;
  outline: none;
}

.qhb-select-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
}

.qhb-select {
  flex: 1;
  padding: 6px 12px;
  border: 1.5px solid #3b82f6;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  color: #1e293b;
  font-weight: 600;
  outline: none;
  transition: all 0.2s;
  cursor: pointer;
}

.qhb-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.qhb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#btn-quick-prev-bill, #btn-quick-next-bill {
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#btn-quick-prev-bill:hover, #btn-quick-next-bill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.2);
}

/* 当日出库单横向快捷胶囊卡片流 */
.quick-order-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.order-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s;
}

.order-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.order-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.order-chip .chip-date {
  font-size: 11px;
  background: #f1f5f9;
  color: #64748b;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-family: monospace;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.order-chip.active .chip-date {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

/* 顶部各类报价单胶囊芯片横向展示流 (类似第二张图) */
.quotation-schemes-chips-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  margin-bottom: 0;
  align-items: center;
}

.scheme-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease-in-out;
}

.scheme-chip:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.scheme-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.2);
}

.scheme-chip .chip-name {
  pointer-events: none;
}

.scheme-chip .chip-subname {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  line-height: 1.3;
  pointer-events: none;
}

.scheme-chip.active .chip-subname {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.3);
  font-weight: 600;
}

.scheme-chip .btn-chip-rename {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  color: #64748b;
  opacity: 0.6;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.scheme-chip:hover .btn-chip-rename,
.scheme-chip.active .btn-chip-rename {
  opacity: 1;
  color: #2563eb;
}

.scheme-chip .btn-chip-rename:hover {
  background: rgba(37, 99, 235, 0.15);
  transform: scale(1.1);
}

.scheme-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1.5px dashed #94a3b8;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.scheme-chip-add:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-1px);
}

/* 🏢 采购入库 - 供应商横向胶囊导航栏 (与报价方案第二张图完全一致) */
.supplier-chips-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  margin-bottom: 0;
  align-items: center;
  scrollbar-width: thin;
}

.supplier-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease-in-out;
}

.supplier-chip:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.supplier-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.2);
}

.supplier-chip .chip-name {
  pointer-events: none;
}

.supplier-chip .chip-subname {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  line-height: 1.3;
  pointer-events: none;
}

.supplier-chip.active .chip-subname {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.3);
  font-weight: 600;
}

.supplier-chip .btn-chip-rename {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  color: #64748b;
  opacity: 0.6;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.supplier-chip:hover .btn-chip-rename,
.supplier-chip.active .btn-chip-rename {
  opacity: 1;
  color: #2563eb;
}

.supplier-chip .btn-chip-rename:hover {
  background: rgba(37, 99, 235, 0.15);
  transform: scale(1.1);
}

.supplier-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1.5px dashed #94a3b8;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.supplier-chip-add:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-1px);
}

/* 出库单快捷胶囊卡片与删除按钮 */
.order-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.order-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.order-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.order-chip .chip-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-left: 4px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.25);
  color: #64748b;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.order-chip:hover .chip-del-btn,
.order-chip.active .chip-del-btn {
  opacity: 1;
}

.order-chip .chip-del-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.15);
}

.btn-outline-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
  transition: all 0.15s ease;
}

.btn-outline-danger:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #ef4444;
}

/* 查看出库单锁定防误触模式 */
.order-locked-table .excel-cell-input {
  cursor: default !important;
  user-select: text;
}

.order-locked-table tr:hover td {
  background-color: #f8fafc !important;
}

.order-locked-table .excel-cell-input:focus {
  outline: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
}

/* ========================================================
   客户档案库：二段式下滑展开（主行 + 下级档口明细二级行）
   ======================================================== */
.customer-master-row {
  transition: background-color 0.18s ease;
}

.customer-master-row:hover td {
  background-color: #f8fafc;
}

.customer-master-row.is-expanded td {
  background-color: #eff6ff !important;
  border-bottom-color: #bfdbfe !important;
}

/* 二段展开切换按钮 */
.subrow-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.subrow-toggle-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.subrow-toggle-btn.has-stalls {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.subrow-toggle-btn.has-stalls:hover {
  background: #dcfce7;
  border-color: #4ade80;
}

.subrow-toggle-btn.is-active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.subrow-toggle-btn .arrow-icon {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.subrow-toggle-btn.is-active .arrow-icon {
  transform: rotate(180deg);
}

/* 二段子行（Subrow） */
.customer-subrow {
  display: none;
}

.customer-subrow.is-open {
  display: table-row;
}

.customer-subrow-td {
  padding: 0 !important;
  background-color: #f8fafc;
  border-bottom: 2px solid #cbd5e1 !important;
}

/* 下滑展开动画包装盒 */
.customer-subrow-slider {
  padding: 14px 20px 16px 24px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  border-left: 4px solid #2563eb;
  animation: slideDownSubrow 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: inset 0 3px 6px -3px rgba(0, 0, 0, 0.05);
}

@keyframes slideDownSubrow {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 二段内各元素 */
.subrow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.subrow-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3a8a;
}

.subrow-desc {
  font-size: 12px;
  color: #64748b;
}

/* 二段内档口表格 */
.sub-stalls-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  font-size: 13px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sub-stalls-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
}

.sub-stalls-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.sub-stalls-table tr:last-child td {
  border-bottom: none;
}

.sub-stalls-table tr:hover td {
  background-color: #f8fafc;
}

/* 二段内快速添加档口表单栏 */
.subrow-quick-add {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px dashed #93c5fd;
  flex-wrap: wrap;
}

.subrow-quick-add input {
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}

.subrow-quick-add input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ========================================================
   打印容器防护：在屏幕常规浏览模式下彻底隐藏与排除排版
   ======================================================== */
@media screen {
  #actual-print-area,
  .actual-print-area {
    display: none !important;
    visibility: hidden !important;
    position: fixed !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -999 !important;
  }
}

/* ========================================================
   浏览器风格多单据顶部标签页栏 (Browser Tabs Bar)
   ======================================================== */
.browser-tabs-bar {
  display: flex;
  align-items: flex-end;
  background: #cbd5e1;
  padding: 6px 10px 0 10px;
  border-radius: 12px 12px 0 0;
  border: 1px solid #94a3b8;
  border-bottom: none;
  gap: 4px;
  user-select: none;
  position: relative;
  z-index: 10;
  max-width: 100%;
  box-sizing: border-box;
}

.browser-tabs-scroll {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-width: 0; /* 核心约束：防止子标签把外层父容器撑爆超宽 */
  padding-bottom: 0;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.browser-tabs-scroll::-webkit-scrollbar {
  display: none;
}

/* 标签页滚动导航微调按钮 (‹ 和 ›) */
.browser-tab-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 26px;
  margin-bottom: 3px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: #1e293b;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.browser-tab-nav-btn:hover:not(:disabled):not(.is-disabled) {
  background: #ffffff;
  color: #2563eb;
  border-color: #3b82f6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.browser-tab-nav-btn:disabled,
.browser-tab-nav-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.3);
}

/* 单个浏览器标签页 */
.browser-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px 8px 11px;
  background: #94a3b8;
  color: #1e293b;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  max-width: 175px;
  min-width: 85px;
  flex-shrink: 0;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: none;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
}

.browser-tab:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* 激活的标签页：白底，与下方出库单白卡片完美无缝融合 */
.browser-tab.active {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 700;
  border-color: #94a3b8;
  border-top: 3px solid #2563eb;
  padding-top: 5px;
  margin-bottom: -1px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  z-index: 20;
}

.browser-tab .tab-icon {
  font-size: 13px;
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
}

.browser-tab .tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 12.5px;
}

.browser-tab .tab-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  margin-left: 2px;
  flex-shrink: 0;
}

.browser-tab .tab-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

/* 右侧工具组 */
.browser-tabs-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  flex-shrink: 0;
}

/* 浏览器新建标签 [+] 按钮 */
.browser-new-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.65);
  color: #334155;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.browser-new-tab-btn:hover {
  background: #ffffff;
  color: #2563eb;
  border-color: #3b82f6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 标签页快捷清单下拉按钮 */
.browser-tabs-dropdown-wrap {
  position: relative;
}

.browser-tabs-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.65);
  color: #1e293b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.browser-tabs-dropdown-btn:hover {
  background: #ffffff;
  color: #2563eb;
  border-color: #3b82f6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 标签页快捷下拉菜单 */
.browser-tabs-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  min-width: 300px;
  max-width: 380px;
  max-height: 400px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 6px;
  z-index: 1000;
}

.browser-tabs-menu-header {
  padding: 6px 10px 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.browser-tabs-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.12s;
  gap: 10px;
}

.browser-tabs-menu-item:hover {
  background: #f1f5f9;
}

.browser-tabs-menu-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* 配合顶部标签页栏，将下方开单卡片的顶部直角处理为平齐 */
#tab-create-order .order-form-card {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-top: 1px solid #cbd5e1;
}

/* ========================================================
   出库单多模板工作台 & 单位专属模板定制样式
   ======================================================== */
.template-top-manager-bar {
  background: linear-gradient(to right, #ffffff, #f8fafc);
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.template-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.template-badge-custom {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.template-badge-default {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* 打印单底部服务提示语/条款 */
.ps-footer-notice {
  margin-top: 8px;
  padding: 4px 6px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #333333;
  font-family: "SimSun", "Songti SC", "STSong", "SimHei", serif;
  border-top: 1px dashed #666666;
  text-align: left;
}

/* 打印单表尾三联签章项 */
.ps-sign-container.ps-sign-3items {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px 2px 12px;
  font-size: 13.5px;
}

.ps-sign-container.ps-sign-3items .ps-sign-item {
  flex: 1;
}

@media print {
  .ps-footer-notice {
    color: #000 !important;
    border-top: 1px dashed #000 !important;
  }
}

/* 打印单纸上就地直觉编辑动效与指示 */
#print-sheet-container .canvas-editable {
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  border-radius: 3px;
  padding: 1px 4px;
}

#print-sheet-container .canvas-editable:hover {
  background-color: rgba(59, 130, 246, 0.08);
  outline: 1.5px dashed #2563eb;
}

#print-sheet-container .canvas-editable:hover::after {
  content: '✏️双击修改';
  font-size: 11px;
  color: #1d4ed8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 5px;
  border-radius: 4px;
  position: absolute;
  right: 0;
  top: -20px;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

#print-sheet-container th.canvas-th-editable {
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

#print-sheet-container th.canvas-th-editable:hover {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
  outline: 1.5px dashed #2563eb;
}

/* 打印单表格列宽鼠标拉动微调把手 */
.th-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  bottom: 0;
  cursor: col-resize;
  z-index: 30;
  user-select: none;
}

.th-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 4px;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background-color 0.15s ease;
}

.th-resizer:hover::after,
.th-resizer.is-resizing::after {
  background-color: #2563eb !important;
  box-shadow: 0 0 4px rgba(37, 99, 235, 0.6);
}

@media print {
  .th-resizer {
    display: none !important;
  }
}

/* 商品多单位报价体系样式 */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.2;
}

.badge-primary {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-info {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-success {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-warning {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.quotation-units-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
}

.quotation-multi-prices-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
  align-items: center;
  justify-content: center;
}

.unit-price-editor-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.unit-price-box {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 4px;
  transition: all 0.15s ease;
}

.unit-price-box:focus-within {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.unit-price-box.is-custom {
  border-color: #93c5fd;
  background-color: #f8fafc;
}

.btn-add-unit-to-goods:hover {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #3b82f6 !important;
}

.btn-del-goods-unit {
  opacity: 0.65;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-del-goods-unit:hover {
  opacity: 1 !important;
  color: #dc2626 !important;
  transform: scale(1.15);
}

.btn-del-unit-badge {
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-del-unit-badge:hover {
  opacity: 1 !important;
  color: #b91c1c !important;
}

.btn-reset-base-unit-price {
  transition: color 0.15s, transform 0.15s;
}

.btn-reset-base-unit-price:hover {
  color: #2563eb !important;
  transform: rotate(-45deg);
}

.btn-edit-base-unit {
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-edit-base-unit:hover {
  background-color: #1d4ed8 !important;
  transform: translateY(-1px);
  box-shadow: 0 1px 4px rgba(29, 78, 216, 0.35);
}

/* ========================================================
   开单表格 单元格双击悬浮快捷选择器 (单位/单价)
   ======================================================== */
.cell-floating-popover {
  position: fixed;
  z-index: 99999;
  width: 370px;
  background: #ffffff;
  border: 1.5px solid #2563eb;
  border-radius: 10px;
  box-shadow: 0 14px 35px -4px rgba(15, 23, 42, 0.25), 0 6px 12px -2px rgba(15, 23, 42, 0.12);
  animation: popoverFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-family: var(--font-sans);
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 13px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border-bottom: 1px solid #e2e8f0;
}

.popover-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.popover-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.popover-close-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.popover-body {
  padding: 12px 14px;
  max-height: 390px;
  overflow-y: auto;
  font-size: 13px;
}

.popover-section-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
}

/* 单位卡片列表 */
.popover-unit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.popover-unit-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popover-unit-card:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.popover-unit-card.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 1.5px #2563eb;
}

/* 常用小标签网格 */
.popover-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.popover-pill-btn {
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popover-pill-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

.popover-pill-btn.is-active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 700;
}

/* 单价方案列表 */
.popover-price-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.popover-price-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popover-price-card:hover {
  background: #f0fdf4;
  border-color: #10b981;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.popover-price-card.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 1.5px #2563eb;
}

.popover-price-card .price-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14.5px;
  color: #059669;
}

/* ========================================================
   出库单打价格防亏本与成本警示样式
   ======================================================== */
.excel-grid-table input.price-loss-warning {
  background-color: #fff1f2 !important;
  color: #e11d48 !important;
  font-weight: 700 !important;
  border-bottom: 2px dashed #f43f5e !important;
  animation: pulseLoss 1.5s infinite ease-in-out;
}

@keyframes pulseLoss {
  0%, 100% {
    background-color: #fff1f2;
  }
  50% {
    background-color: #ffe4e6;
  }
}

.excel-grid-table tr:has(.price-loss-warning) {
  background-color: #fffcfc !important;
}

/* 进货成本标签 */
.cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.profit-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.loss-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11.5px;
  font-weight: 700;
}

/* 采购入库模块样式 */
.inbound-view-switcher .btn-sub-tab {
  transition: all 0.15s ease;
}
.inbound-view-switcher .btn-sub-tab:hover:not(.active) {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

/* 单价点击时出现的入库成本小气泡 (透明玻璃效果的纯净白色，定位在右上角) */
.price-cost-bubble {
  position: fixed;
  z-index: 999999;
  /* 现代高端白色毛玻璃效果 (White Glassmorphism) */
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: #1e293b;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 
    0 8px 24px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.04),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(-2px);
  user-select: none;
}

.price-cost-bubble.is-loss {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.6) !important;
  box-shadow: 
    0 8px 24px rgba(220, 38, 38, 0.18),
    0 2px 6px rgba(220, 38, 38, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
}

.price-cost-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: var(--bubble-arrow-left, 16px);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.08));
}

.price-cost-bubble.is-loss::after {
  border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

.price-cost-bubble.arrow-top::after {
  bottom: auto;
  top: -6px;
  border-width: 0 6px 6px 6px;
  border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent;
}

.price-cost-bubble.is-loss.arrow-top::after {
  border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent;
}

/* ==========================================================================
   系统设置 & 个性化偏好界面样式 (含长辈模式、超粗字重与自定义简字)
   ========================================================================== */

/* 1. 更多字号缩放模式：特大远视模式 (145% 缩放) */
body.font-scale-giant {
  font-size: 18px;
}
body.font-scale-giant .excel-grid-table th {
  font-size: 17.5px !important;
  font-weight: 900 !important;
}
body.font-scale-giant .excel-cell-input,
body.font-scale-giant .excel-cell-seq {
  font-size: 19.5px !important;
  font-weight: 800 !important;
}
body.font-scale-giant .input-goods-price,
body.font-scale-giant .input-goods-qty,
body.font-scale-giant .excel-cell-number {
  font-size: 21.5px !important;
  font-weight: 900 !important;
}
body.font-scale-giant .form-header-grid input,
body.font-scale-giant .form-header-grid label,
body.font-scale-giant .form-header-grid select {
  font-size: 17.5px !important;
}
body.font-scale-giant .form-header-grid input {
  height: 46px !important;
  font-weight: 800 !important;
}
body.font-scale-giant .form-header-grid label {
  font-weight: 900 !important;
}
body.font-scale-giant .browser-tab {
  font-size: 17px !important;
  padding: 10px 20px !important;
}
body.font-scale-giant .browser-tab .tab-title {
  font-size: 17px !important;
  font-weight: 900 !important;
}
body.font-scale-giant .chinese-amount-preview,
body.font-scale-giant .order-summary-box {
  font-size: 21px !important;
  font-weight: 900 !important;
}
body.font-scale-giant .sidebar.collapsed .nav-item .nav-short {
  font-size: 18px !important;
  font-weight: 900 !important;
}
body.font-scale-giant .nav-item {
  font-size: 17px !important;
}

/* 2. 自定义微调像素模式 */
body.font-custom-size {
  font-size: var(--app-custom-font-size, 14px) !important;
}
body.font-custom-size .excel-cell-input,
body.font-custom-size .excel-cell-seq {
  font-size: calc(var(--app-custom-font-size, 14px) + 1.5px) !important;
}
body.font-custom-size .excel-grid-table th {
  font-size: var(--app-custom-font-size, 14px) !important;
}
body.font-custom-size .input-goods-price,
body.font-custom-size .input-goods-qty,
body.font-custom-size .excel-cell-number {
  font-size: calc(var(--app-custom-font-size, 14px) + 2.5px) !important;
}

/* 3. 超粗字重增强 (强力黑体加粗关爱模式) */
body.font-weight-extrabold {
  font-weight: 700 !important;
  -webkit-font-smoothing: antialiased;
}
body.font-weight-extrabold input,
body.font-weight-extrabold select,
body.font-weight-extrabold button,
body.font-weight-extrabold td,
body.font-weight-extrabold th,
body.font-weight-extrabold .excel-cell-input,
body.font-weight-extrabold .nav-text,
body.font-weight-extrabold .nav-short,
body.font-weight-extrabold .tab-title,
body.font-weight-extrabold .order-summary-box,
body.font-weight-extrabold .chinese-amount-preview {
  font-weight: 800 !important;
  text-shadow: 0 0 0.2px rgba(0,0,0,0.4);
}

/* 4. 高清晰对比度模式 */
body.contrast-enhanced {
  color: #0f172a !important;
}
body.contrast-enhanced .excel-grid-table,
body.contrast-enhanced .data-table,
body.contrast-enhanced input,
body.contrast-enhanced select {
  border-color: #334155 !important;
}
body.contrast-enhanced .excel-cell-input {
  color: #000000 !important;
}
body.contrast-enhanced .excel-grid-table th {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* 5. 设置主容器布局 */
.settings-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 12px;
  color: #ffffff;
  padding: 22px 28px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  gap: 20px;
  flex-wrap: wrap;
}

.settings-hero-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-hero-icon {
  font-size: 38px;
  line-height: 1;
}

.settings-hero-title h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.settings-hero-title p {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
}

.settings-hero-actions {
  display: flex;
  gap: 12px;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 22px;
}

/* 设置卡片容器 */
.settings-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.settings-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.settings-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  font-size: 22px;
  line-height: 1;
}

.settings-card-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.card-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  display: block;
}

.settings-card-body {
  padding: 22px 24px;
}

.settings-row {
  margin-bottom: 20px;
}

.settings-row:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}

/* 字体预设按钮卡片 */
.font-preset-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.font-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 16px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.font-preset-btn:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.font-preset-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.16);
}

.preset-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.font-preset-btn.active .preset-name {
  color: #1d4ed8;
}

.preset-desc {
  font-size: 11.5px;
  color: #64748b;
}

/* 精细滑块 */
.slider-control-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.slider-min,
.slider-max {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.custom-range-slider {
  flex: 1;
  height: 6px;
  accent-color: #2563eb;
  cursor: pointer;
}

.slider-val-badge {
  font-size: 14px;
  font-weight: 800;
  background: #2563eb;
  color: #ffffff;
  padding: 3px 12px;
  border-radius: 14px;
  min-width: 52px;
  text-align: center;
}

/* 开关行 */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.toggle-info {
  flex: 1;
  padding-right: 20px;
}

.toggle-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 3px;
}

.toggle-desc {
  font-size: 12px;
  color: #64748b;
}

/* iOS 风格平滑滑动开关 */
.custom-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 26px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.custom-switch input:checked + .switch-slider {
  background-color: #2563eb;
}

.custom-switch input:checked + .switch-slider:before {
  transform: translateX(24px);
}

/* 实时预览卡片 */
.settings-preview-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  margin-top: 20px;
}

.preview-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 12px;
}

.preview-box-sample {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.preview-sample-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #334155;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

.preview-sample-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
}

.preview-sample-table th,
.preview-sample-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  text-align: left;
}

.preview-sample-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
}

.preview-sample-footer {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  margin-top: 10px;
  font-size: 13.5px;
}

.preview-money {
  color: #dc2626;
  font-size: 15px;
}

/* 侧边栏折叠简字自定义 */
.short-labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.short-label-item {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  gap: 10px;
}

.short-label-orig {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  min-width: 90px;
}

.short-label-arrow {
  color: #94a3b8;
  font-size: 13px;
}

.short-label-input {
  width: 44px;
  height: 38px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #1d4ed8;
  border: 2px solid #93c5fd;
  border-radius: 6px;
  background: #ffffff;
  outline: none;
  transition: all 0.2s;
}

.short-label-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  background: #eff6ff;
}

.short-label-hint {
  font-size: 11.5px;
  color: #64748b;
  flex: 1;
}

/* 提示框 */
.settings-tip-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.5;
}

/* 双列网格 */
.form-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* 备份栏 */
.settings-backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   系统全屏登录界面样式 (Login Page)
   ========================================================================== */
.login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 15% 25%, #1e293b 0%, #0f172a 60%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}

.login-backdrop-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.glow-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.28) 0%, rgba(37, 99, 235, 0) 70%);
  top: -120px;
  left: -120px;
  animation: glowFloat 8s ease-in-out infinite alternate;
}

.glow-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(5, 150, 105, 0) 70%);
  bottom: -140px;
  right: -120px;
  animation: glowFloat 10s ease-in-out infinite alternate-reverse;
}

@keyframes glowFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.1); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2);
  animation: loginCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.login-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.login-brand-text h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.login-brand-text span {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.login-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}

.login-header p {
  margin: 0 0 18px;
  font-size: 13px;
  color: #64748b;
}

/* 快捷角色按钮 */
.login-quick-roles {
  margin-bottom: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.quick-roles-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  display: block;
}

.quick-roles-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.quick-role-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
}

.quick-role-btn:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.quick-role-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.18);
}

/* 登录输入框 */
.login-form-group {
  margin-bottom: 16px;
}

.login-form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  pointer-events: none;
  opacity: 0.8;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 38px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
  outline: none;
  transition: all 0.2s;
  background: #ffffff;
}

.login-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

.login-password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.65;
  padding: 4px;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.login-password-toggle:hover {
  opacity: 1;
}

.login-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: #475569;
}

.login-remember-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.login-error-alert {
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
  text-align: center;
}

.btn-login-submit {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.btn-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  filter: brightness(1.04);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.login-footer-info {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

/* 顶部状态栏右侧用户个人信息徽标 */
.header-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 8px 3px 6px;
  border-radius: 20px;
  font-size: 12px;
  user-select: none;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-avatar-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.user-text-wrap {
  display: flex;
  flex-direction: column;
}

.user-display-name {
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.user-display-role {
  font-size: 10px;
  color: #64748b;
  line-height: 1;
}

.btn-header-logout {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  line-height: 1.2;
}

.btn-header-logout:hover {
  background: #fecaca;
  color: #991b1b;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   自定义现代化极简弹窗 UI (替代浏览器原生 alert & confirm)
   ========================================================================== */

.erp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
}

.erp-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.erp-custom-dialog {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.erp-modal-overlay.active .erp-custom-dialog {
  transform: scale(1) translateY(0);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 22px 14px 22px;
  position: relative;
}

.dialog-icon-circle {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dialog-icon-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.dialog-icon-warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.dialog-icon-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.dialog-icon-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.dialog-title-wrap {
  flex: 1;
  padding-right: 20px;
}

.dialog-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}

.dialog-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dialog-close-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.dialog-body {
  padding: 0 22px 20px 22px;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}

.dialog-main-msg {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
}

.dialog-sub-tip {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px 20px 22px;
  background: #ffffff;
}

.dialog-btn {
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  outline: none;
}

.dialog-btn:active {
  transform: scale(0.97);
}

.dialog-btn-cancel {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.dialog-btn-cancel:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.dialog-btn-confirm-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: 1px solid #b91c1c;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.32);
}

.dialog-btn-confirm-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.42);
}

.dialog-btn-confirm-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #b45309;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.32);
}

.dialog-btn-confirm-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.42);
}

.dialog-btn-confirm-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

.dialog-btn-confirm-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.42);
}

/* ========================================================
   未报价商品智能关联向导与副名称/别名管理 UI
   ======================================================== */
.badge-subname {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.badge-subname.badge-locked {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.08);
}

.badge-subname.badge-locked:hover {
  background: #d1fae5;
  border-color: #34d399;
}

.badge-subname.badge-provisional {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.badge-subname.badge-provisional:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.badge-subname .badge-del-alias {
  font-size: 12px;
  line-height: 1;
  color: #94a3b8;
  margin-left: 2px;
  border-radius: 50%;
  padding: 0 2px;
}

.badge-subname .badge-del-alias:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.btn-add-goods-alias:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

.badge-subname .btn-edit-alias:hover {
  text-decoration: underline;
  opacity: 1;
}

/* 极简核价表格 */
.table-mapping-fast {
  width: 100%;
  border-collapse: collapse;
}

.table-mapping-fast th {
  padding: 9px 12px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.table-mapping-fast td {
  padding: 6px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.table-mapping-fast tr:hover td {
  background-color: #f8fafc;
}

.table-mapping-fast tr.is-configured td {
  background-color: #fafffd;
}

.table-mapping-fast tr.is-configured:hover td {
  background-color: #ecfdf5;
}

.table-mapping-fast tr.is-highlighted td {
  background-color: #fee2e2 !important;
}

.table-mapping-fast .input-mapping-price:focus,
.table-mapping-fast .input-mapping-unit:focus,
.table-mapping-fast .input-goods-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.2);
  background-color: #eff6ff;
}

.goods-search-dropdown {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.search-drop-item {
  transition: background-color 0.12s ease;
}

.search-drop-item:hover {
  background-color: #eff6ff !important;
  color: #1d4ed8;
}

/* 模态框高层级与优雅入场动画 */
#import-mapping-modal,
#modal-alias-manager {
  z-index: 10050 !important;
}

.fade-in-up {
  animation: fadeInUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUpModal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========================================================
   利润分析与经营决策中心 (Profit Analysis Dashboard & Table)
   ======================================================== */
.profit-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.profit-mode-toolbar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profit-segmented-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.profit-segment-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profit-segment-btn:hover {
  color: #1e293b;
}

.profit-segment-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profit-cost-rule-tip {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 4 大核心 KPI 磁贴卡片 */
.profit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.profit-kpi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.profit-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.profit-kpi-card.kpi-sales::before { background: #3b82f6; }
.profit-kpi-card.kpi-cost::before { background: #f59e0b; }
.profit-kpi-card.kpi-profit::before { background: #10b981; }
.profit-kpi-card.kpi-margin::before { background: #8b5cf6; }

.profit-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.kpi-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.kpi-sales .kpi-icon-wrap { background: #eff6ff; }
.kpi-cost .kpi-icon-wrap { background: #fffbeb; }
.kpi-profit .kpi-icon-wrap { background: #ecfdf5; }
.kpi-margin .kpi-icon-wrap { background: #f5f3ff; }

.kpi-info {
  flex: 1;
  min-width: 0;
}

.kpi-title {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.kpi-sales .kpi-value { color: #1e40af; }
.kpi-cost .kpi-value { color: #b45309; }
.kpi-profit .kpi-value { color: #047857; }
.kpi-margin .kpi-value { color: #6d28d9; }

.kpi-subtext {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
}

/* 图表区 */
.profit-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 1200px) {
  .profit-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chart-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
}

.chart-card-legend {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
}

.legend-sales { background: #3b82f6; }
.legend-profit { background: #10b981; }

.profit-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
  line-height: 1.5;
  transition: opacity 0.15s ease;
}

/* 利润结构分布 */
.profit-structure-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 260px;
  gap: 16px;
}

.structure-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.structure-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.structure-bar-track {
  height: 14px;
  background: #f1f5f9;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.structure-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.profit-structure-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
  text-align: center;
}

.struct-sum-card {
  background: #f8fafc;
  padding: 8px;
  border-radius: 6px;
}

.struct-sum-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.struct-sum-text {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* 下层卡片行：排行与预警 */
.profit-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 14px;
}

@media (max-width: 1300px) {
  .profit-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.rank-card, .warning-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.rank-card-header, .warning-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.rank-idx {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.rank-idx.top-1 { background: #fef08a; color: #854d0e; }
.rank-idx.top-2 { background: #e2e8f0; color: #475569; }
.rank-idx.top-3 { background: #ffedd5; color: #9a3412; }

.rank-name {
  width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #334155;
}

.rank-bar-wrap {
  flex: 1;
  background: #f1f5f9;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.rank-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 4px;
}

.rank-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #059669;
  font-size: 12.5px;
  min-width: 70px;
  text-align: right;
}

/* 异常预警雷达 */
.warning-pulse {
  display: inline-block;
  animation: pulseAlarm 1.4s infinite;
}

@keyframes pulseAlarm {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.warning-list-wrap {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warning-item-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.warning-item-box:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.warning-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.warning-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #991b1b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-item-desc {
  font-size: 11px;
  color: #b91c1c;
}

.warning-item-diff {
  text-align: right;
  font-family: var(--font-mono);
}

/* 详细报表样式 */
.profit-table-summary-bar {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: #334155;
}

.profit-summary-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profit-summary-tag strong {
  font-family: var(--font-mono);
  font-size: 14.5px;
}

.profit-data-table {
  width: 100%;
}

.profit-data-table tbody tr.is-loss-row {
  background: #fff5f5 !important;
}

.profit-data-table tbody tr.is-loss-row:hover {
  background: #fee2e2 !important;
}

.profit-drawer-row td {
  background: #f8fafc !important;
  padding: 0 !important;
  border-top: none !important;
}

.profit-sub-table-wrap {
  padding: 10px 16px 14px 40px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.profit-sub-table {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
}

.profit-sub-table th, .profit-sub-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.profit-sub-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
}



/* ========================================================
   📊 明细导出中心 (ExportCenter) 专属样式
   ======================================================== */
.btn-export-tab {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: #475569;
}
.btn-export-tab.active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

.btn-date-preset {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-date-preset:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
}
.btn-date-preset.active {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #3b82f6 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(59,130,246,0.15);
}

.export-page-unit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.export-page-unit-card:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}
.export-page-unit-card.active-outbound {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 1px 3px rgba(37,99,235,0.12);
}
.export-page-unit-card.active-inbound {
  background: #f0fdf4 !important;
  border-color: #22c55e !important;
  box-shadow: 0 1px 3px rgba(34,197,94,0.12);
}
.export-page-unit-card .unit-name-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 145px;
}
.export-page-unit-card .unit-badge-count {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
}
.export-page-unit-card.active-outbound .unit-badge-count {
  color: #1d4ed8;
  background: #dbeafe;
}
.export-page-unit-card.active-inbound .unit-badge-count {
  color: #15803d;
  background: #dcfce7;
}

.export-measure-tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.export-measure-tag:hover {
  background: #f1f5f9;
}
.export-measure-tag.active {
  background: #3b82f6 !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  font-weight: 600;
}

.export-col-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.export-col-card:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}
.export-col-card.active {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  box-shadow: 0 1px 3px rgba(37,99,235,0.12);
}
.export-col-card.active .col-title-text {
  color: #1d4ed8;
  font-weight: 700;
}
.export-col-card .col-title-text {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}


/* 称重台实时回传数据高亮呼吸特效 */
@keyframes scaleSyncHighlight {
  0% { background-color: #a7f3d0; box-shadow: 0 0 8px #10b981; }
  50% { background-color: #ecfdf5; box-shadow: 0 0 12px #34d399; }
  100% { background-color: transparent; box-shadow: none; }
}
.scale-sync-flash {
  animation: scaleSyncHighlight 1.2s ease-out !important;
  font-weight: 800 !important;
  color: #047857 !important;
}

/* ==============================================================================
   电子秤录入纯颜色视觉体系 (实称浅绿、缺货浅粉、无任何徽标遮挡数字)
   ============================================================================== */
/* 电子秤实称输入框：淡雅浅绿背景与深绿数字 */
.input-goods-qty.is-scale-weighed {
  background-color: #ecfdf5 !important;
  color: #047857 !important;
  font-weight: 800 !important;
  border-color: #86efac !important;
  box-shadow: inset 0 0 0 1px #a7f3d0 !important;
}

/* 电子秤标记缺货输入框：淡粉红背景与红字 */
.input-goods-qty.is-scale-outstock {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  font-weight: 800 !important;
  border-color: #fca5a5 !important;
  box-shadow: inset 0 0 0 1px #fecaca !important;
}

/* 彻底隐藏所有徽标，确保数字完整无阻挡展现 */
.scale-source-badge {
  display: none !important;
}

/* 打印时自动隐藏所有底色，还原纯黑白出库单 */
@media print {
  .input-goods-qty.is-scale-weighed,
  .input-goods-qty.is-scale-outstock {
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
}

/* ===== 报价表商品分类与前端分组精致样式 ===== */
.quotation-cat-chip {
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
  user-select: none;
}
.quotation-cat-chip:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.quotation-cat-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}
.quotation-cat-chip.active .cat-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.quotation-cat-chip .cat-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 700;
}

/* 报价表格分类分组行 */
.quotation-group-header-row td {
  background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-top: 2px solid #cbd5e1 !important;
  border-bottom: 1.5px solid #cbd5e1 !important;
  padding: 7px 16px !important;
  text-align: left !important;
}
.cat-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}
.cat-group-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
}

/* 单元格分类标签 */
.btn-change-category {
  padding: 2.5px 8px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
  transition: all 0.15s ease;
  user-select: none;
}
.btn-change-category:hover {
  filter: brightness(0.95);
  transform: translateY(-0.5px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ==========================================================================
   全局商品分类库专用高颜值样式
   ========================================================================== */
.category-summary-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  scroll-behavior: smooth;
}
.category-summary-cards::-webkit-scrollbar {
  height: 6px;
}
.category-summary-cards::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.category-summary-card {
  flex: 0 0 auto;
  min-width: 145px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.category-summary-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px -3px rgba(59, 130, 246, 0.15);
}
.category-summary-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.25);
}

.category-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.category-summary-icon-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.category-summary-icon {
  font-size: 20px;
  line-height: 1;
}
.category-summary-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}
.category-summary-percent {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 9999px;
}
.category-summary-card.active .category-summary-percent {
  background: #dbeafe;
  color: #1d4ed8;
}

.category-summary-bottom {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.category-summary-count {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1;
}
.category-summary-suffix {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

/* 分类胶囊选择器 */
.category-archive-chip {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.category-archive-chip:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.category-archive-chip.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.category-archive-chip .cat-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
}
.category-archive-chip.active .cat-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* 单元格行内编辑反馈 */
.cat-goods-name-editable,
.cat-goods-subname-editable {
  outline: none;
  transition: all 0.15s ease;
}
.cat-goods-name-editable:hover,
.cat-goods-subname-editable:hover {
  background: #f1f5f9;
  border-radius: 4px;
}
.cat-goods-name-editable:focus,
.cat-goods-subname-editable:focus {
  background: #ffffff;
  box-shadow: 0 0 0 2px #3b82f6;
  border-radius: 4px;
}

/* 方案小胶囊标签 */
.scheme-mini-pill {
  display: inline-block;
  font-size: 11px;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  margin: 1px 2px;
  white-space: nowrap;
}


