/* ============================================================
   三道报账 v1.0.2 - 全局布局与组件样式
   ============================================================ */
@import url('variables.css');

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: var(--font-size-base, 14px);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--theme-primary); text-decoration: none; }
a:hover { color: var(--theme-light); }

/* ===== 布局 ===== */
.hx-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== 侧边栏 ===== */
.hx-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.hx-sidebar-header {
  padding: var(--spacing-lg) var(--spacing-md);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.hx-sidebar-header h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.hx-sidebar-header .hx-subtitle {
  font-size: 0.6875rem;
  color: var(--text-sidebar);
  margin-top: 2px;
}

.hx-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-sm) 0;
}

.hx-nav::-webkit-scrollbar { width: 4px; }
.hx-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.hx-nav-item {
  display: flex;
  align-items: center;
  padding: 10px var(--spacing-md);
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8125rem;
  border-left: 3px solid transparent;
}

.hx-nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-light);
}

.hx-nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--text-light);
  border-left-color: var(--text-light);
  font-weight: 500;
}

.hx-nav-item .hx-nav-icon { margin-right: var(--spacing-sm); font-size: 1rem; width: 20px; text-align: center; }
.hx-nav-item .hx-nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.625rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* ===== 主内容区 ===== */
.hx-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===== 顶部栏 ===== */
.hx-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.hx-header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--theme-primary);
}

.hx-header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.hx-user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.hx-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--theme-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.hx-user-role-tag {
  font-size: 0.6875rem;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--info-light);
  color: var(--info);
  font-weight: 500;
}

/* ===== 内容区 ===== */
.hx-content {
  flex: 1;
  overflow-y: auto;
  /* 🛠️ 2026-09-11 v2.7.617：竖向滚动条出现/消失导致内容区宽度跳动（发票页“先变大后正常”）
     用 scrollbar-gutter:stable 常驻预留滚动条槽位，根治布局抖动 */
  scrollbar-gutter: stable;
  padding: var(--spacing-lg);
  background: var(--bg-primary);
}

/* ===== 面板容器 ===== */
.hx-panel { display: none; }
.hx-panel.active { display: block; }

.hx-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

.hx-panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--theme-primary);
}

.hx-panel-actions { display: flex; gap: var(--spacing-sm); }

/* ===== 搜索/筛选栏 ===== */
.hx-filter-bar {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.hx-filter-bar input,
.hx-filter-bar select {
  height: 34px;
  padding: 0 var(--spacing-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.hx-filter-bar input:focus,
.hx-filter-bar select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(15,52,96,0.1);
}

/* ===== 按钮 ===== */
.hx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.hx-btn:active { transform: scale(0.97); }
.hx-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hx-btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.hx-btn-primary:hover { background: var(--btn-primary-hover); }

.hx-btn-success { background: var(--btn-success-bg); color: var(--btn-success-text); }
.hx-btn-success:hover { background: var(--btn-success-hover); }

.hx-btn-warning { background: var(--btn-warning-bg); color: var(--btn-warning-text); }
.hx-btn-warning:hover { background: var(--btn-warning-hover); }

.hx-btn-danger { background: var(--btn-danger-bg); color: var(--btn-danger-text); }
.hx-btn-danger:hover { background: var(--btn-danger-hover); }

.hx-btn-info { background: var(--btn-info-bg); color: var(--btn-info-text); }
.hx-btn-info:hover { background: var(--btn-info-hover); }

.hx-btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); }
.hx-btn-secondary:hover { background: var(--btn-secondary-hover); }

.hx-btn-export { background: var(--btn-export-bg); color: var(--btn-export-text); }
.hx-btn-export:hover { background: var(--btn-export-hover); }

.hx-btn-sm { height: 28px; padding: 0 10px; font-size: 0.75rem; }
.hx-btn-lg { height: 40px; padding: 0 24px; font-size: 0.9375rem; }

/* ===== 表格 ===== */
.hx-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--table-border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.hx-table-wrapper table { border-collapse: separate; border-spacing: 0; }
.hx-table-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-primary);
  border-bottom: 2px solid var(--table-border);
}

.hx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.hx-table th {
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--table-border);
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.hx-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--table-border);
  color: var(--text-primary);
}

.hx-table tbody tr:nth-child(even) { background: var(--table-stripe); }
.hx-table tbody tr:hover { background: var(--table-hover); }
.hx-table tbody tr.hx-row-selected { background: var(--row-selected, #D6EAF8) !important; outline: 2px solid #3498DB; outline-offset: -1px; }

.hx-table .hx-amount {
  font-family: var(--font-mono);
  text-align: right;
  font-weight: 500;
}

.hx-table .hx-amount-negative { color: var(--danger); }

.hx-table .hx-empty-row {
  text-align: center;
  padding: 40px 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== 状态标签 ===== */
.hx-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.status-pending { background: var(--warning-light); color: var(--warning); }
.status-approved { background: var(--success-light); color: var(--success); }
.status-rejected { background: var(--danger-light); color: var(--danger); }
.status-paid { background: var(--info-light); color: var(--info); }

/* ===== 统计卡片 ===== */
.hx-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.hx-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.hx-stat-card .hx-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hx-stat-card .hx-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--theme-primary);
}

.hx-stat-card .hx-stat-value.positive { color: var(--success); }
.hx-stat-card .hx-stat-value.negative { color: var(--danger); }

/* ===== Toast ===== */
.hx-toast {
  position: fixed;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 10000;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-slow);
  animation: hx-slide-in 0.3s ease;
  max-width: 400px;
}

.hx-toast-info { background: var(--info); }
.hx-toast-success { background: var(--success); }
.hx-toast-warning {
  background: #FFF3CD;
  color: #8A6D1A;
  border: 1px solid #FFE69C;
}
.hx-toast-error { background: var(--danger); }

@keyframes hx-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 加载 ===== */
.hx-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  gap: var(--spacing-sm);
}

.hx-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--theme-primary);
  border-radius: 50%;
  animation: hx-spin 0.8s linear infinite;
}

@keyframes hx-spin { to { transform: rotate(360deg); } }

/* ===== 表单 ===== */
.hx-form-group {
  margin-bottom: var(--spacing-md);
}

.hx-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hx-form-group input,
.hx-form-group select,
.hx-form-group textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.hx-form-group input:focus,
.hx-form-group select:focus,
.hx-form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(15,52,96,0.1);
}

.hx-form-group textarea { height: 80px; padding: 8px 10px; resize: vertical; }

.hx-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.hx-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.hx-form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ===== 分页 ===== */
.hx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
}

.hx-pagination-info { font-size: 0.75rem; color: var(--text-muted); }

.hx-pagination-btns {
  display: flex;
  gap: 4px;
}

.hx-pagination-btns button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.hx-pagination-btns button:hover { background: var(--table-hover); border-color: var(--theme-primary); }
.hx-pagination-btns button.active { background: var(--theme-primary); color: white; border-color: var(--theme-primary); }
.hx-pagination-btns button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 滚动条 ===== */
.hx-content::-webkit-scrollbar { width: 6px; }
.hx-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.hx-content::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== 响应式 ===== */

/* 侧边栏遮罩 + 汉堡菜单按钮 */
.hx-sidebar-toggle {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--theme-primary);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
}
.hx-sidebar-toggle:hover { background: var(--theme-secondary); }

.hx-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.hx-sidebar-overlay.show { display: block; }

/* 手机端侧边栏弹出 */
@media (max-width: 768px) {
  .hx-sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: left 0.25s ease;
    display: flex;
  }
  .hx-sidebar.open { left: 0; }
  /* 🛠️ 2026-09-01 王总：手机端顶栏(fixed全宽 z-index:1000)盖住汉堡按钮(z-index:200)点不到——汉堡按钮提到顶栏之上 */
  .hx-sidebar-toggle { display: flex; z-index: 1001; }
  .hx-sidebar-overlay.show { display: block; }
  .hx-header { padding-left: 56px; }
  .hx-content { padding: var(--spacing-sm); }
  .hx-layout { flex-direction: column; }
  .hx-form-row, .hx-form-row-3, .hx-form-row-4 { grid-template-columns: 1fr; }
  .hx-stats-grid { grid-template-columns: 1fr 1fr; }

  /* 表格手机端 */
  .hx-table th, .hx-table td {
    padding: 6px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .hx-table .hx-amount { font-size: 0.75rem; }

  /* 筛选栏紧凑 */
  .hx-filter-bar {
    gap: 6px;
    flex-wrap: wrap;
  }
  .hx-filter-bar input,
  .hx-filter-bar select {
    height: 32px;
    font-size: 0.75rem;
    max-width: 120px;
  }

  /* 面板标题紧凑 */
  .hx-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  .hx-panel-title { font-size: 1rem; }
  .hx-panel-actions { width: 100%; flex-wrap: wrap; }

  /* 统计卡片 */
  .hx-stat-card { padding: 12px; }
  .hx-stat-card .hx-stat-value { font-size: 1.125rem; }

  /* 统计网格 */
  .hx-stat-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* 分页紧凑 */
  .hx-pagination { flex-direction: column; gap: 4px; }

  /* Toast 位置调整 */
  .hx-toast {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 0.75rem;
    padding: 10px 14px;
  }

  /* 按钮手机友好 */
  .hx-btn { font-size: 0.75rem; }
  .hx-btn-sm { height: 30px; padding: 0 10px; font-size: 0.6875rem; }
}

/* 极小屏（< 480px）卡片模式 */
@media (max-width: 480px) {
  .hx-stats-grid,
  .hx-stat-cards { grid-template-columns: 1fr 1fr; }
  .hx-stat-card .hx-stat-value { font-size: 1rem; }
  .hx-panel-title { font-size: 0.9375rem; }
  .hx-content { padding: 6px; }

  /* 弹窗全屏 */
  .hx-modal {
    width: 95vw !important;
    max-height: 90vh !important;
    margin: 5vh auto !important;
  }
}

/* 侧边栏JS辅助 */
.hx-sidebar-overlay.show { display: block; }


/* 行选中高亮 - 勾选checkbox时整行变色（纯CSS :has 选择器） */
.hx-table tbody tr:has(.freight-check:checked),
.hx-table tbody tr:has(.expense-check:checked),
.hx-table tbody tr:has(.fi-check:checked) {
  background: var(--row-selected, #D6EAF8) !important;
  outline: var(--row-selected-outline, 2px solid var(--row-selected-border, #3498DB));
  outline-offset: -1px;
  box-shadow: var(--row-selected-shadow, 0 0 0 1px var(--row-selected-border, #3498DB), 0 2px 8px rgba(0,0,0,0.15));
  font-weight: var(--row-selected-weight, 400);
}/* 行选中高亮 - 勾选checkbox时整行变色（纯CSS :has 选择器） */
.hx-table tbody tr:has(.freight-check:checked),
.hx-table tbody tr:has(.expense-check:checked),
.hx-table tbody tr:has(.fi-check:checked) {
  background: var(--row-selected, #D6EAF8) !important;
  outline: var(--row-selected-outline, 2px solid var(--row-selected-border, #3498DB));
  outline-offset: -1px;
  box-shadow: var(--row-selected-shadow, 0 0 0 1px var(--row-selected-border, #3498DB), 0 2px 8px rgba(0,0,0,0.15));
  font-weight: var(--row-selected-weight, 400);
}





/* ===== 表头固定+容器内滚动 v1.6.3 试点（精准 class + 弹窗通用） ===== */
.hx-scroll-table {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 210px);
  border: 1px solid var(--table-border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.hx-scroll-table table { border: none; border-collapse: separate; border-spacing: 0; }
.hx-scroll-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F8F9FA;
  border-bottom: 2px solid var(--table-border);
}
/* 弹窗内表格表头固定（modal-body 已有滚动，07资金台账等受益） */
.hx-modal-body table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F8F9FA !important;
}

/* ===== 通用：纵向滚动容器内表格表头固定（2026-08-15 应收/应付全界面统一） ===== */
div[style*="overflow-y:auto"] table,
div[style*="overflow-y: auto"] table,
div[style*="overflow:auto"] table {
  border-collapse: separate !important;
  border-spacing: 0;
}
div[style*="overflow-y:auto"] table thead th,
div[style*="overflow-y: auto"] table thead th,
div[style*="overflow:auto"] table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
  border-bottom: 2px solid #E8ECF1;
}

/* ===== 📍 定位模式：显示模块/区块代号（王总 2026-08-23，WPS 式定位开关）===== */
/* 打开时 body.hx-locator，左侧栏每个模块名边显示浅色 pXX，面板内 [data-code] 显示二级代号；再点或刷新消失 */
body.hx-locator .hx-nav-item::after {
  content: attr(data-panel);
  margin-left: auto;
  font-size: 0.625rem;
  font-weight: 400;
  color: rgba(255,255,255,.35);
  letter-spacing: .5px;
  pointer-events: none;
}
body.hx-locator [data-code]::after {
  content: attr(data-code);
  margin-left: 6px;
  font-size: 0.625rem;
  font-weight: 400;
  color: rgba(15,52,96,.35);
  pointer-events: none;
  vertical-align: middle;
}
body.hx-locator .hx-nav-group::after {
  content: '';
  display: none;
}
/* 权限面板：排除 perm:xxx 权限码与 checkbox 残留，避免杂乱（王总验收 2026-08-23） */
body.hx-locator [data-code^="perm:"]::after,
body.hx-locator input[data-code]::after {
  display: none;
}
/* 暗色模式适配：代号用浅色，避免深蓝色看不清（王总验收 2026-08-23） */
html[data-theme="dark"] body.hx-locator [data-code]::after {
  color: rgba(255,255,255,.4);
}
html[data-theme="dark"] body.hx-locator .hx-nav-item::after {
  color: rgba(255,255,255,.35);
}
/* 顶栏面板标题代号（工作区标题，深蓝底用白字） */
body.hx-locator #panelTitle::after {
  color: rgba(255,255,255,.5);
}
html[data-theme="dark"] body.hx-locator #panelTitle::after {
  color: rgba(255,255,255,.5);
}
#locatorBtn.active {
  background: #0F3460 !important;
  color: #fff !important;
  border-radius: 8px;
}

/* ===== 🛠️ v2.7.334 版本信息高端面板 ===== */
.vtag { border-radius: 4px; padding: 0 4px; font-weight: 600; font-size: 0.75rem; }
.vtag-fix { background: #FDECEA; color: #D93025; }
.vtag-new { background: #E6F4EA; color: #188038; }
.vtag-del { background: #F1F3F4; color: #80868B; }
.vtag-boss { background: #FEF7E0; color: #B06000; }
.vfile { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 0.6875rem; font-family: monospace; margin: 2px 4px 2px 0; border: 1px solid; }
.vfile-m { background: #FFF8E1; border-color: #F9A825; color: #8D6E00; }
.vfile-a { background: #E8F5E9; border-color: #43A047; color: #1B5E20; }
.vfile-d { background: #FFEBEE; border-color: #E53935; color: #B71C1C; }
.vcard:hover { box-shadow: 0 3px 12px rgba(0,0,0,.08); }
html[data-theme="dark"] .vcard { background: #1e2330 !important; border-color: #333a4a !important; }
html[data-theme="dark"] .vfile-m { background: #3a3320; border-color: #8D6E00; color: #FFD54F; }
html[data-theme="dark"] .vfile-a { background: #1e3a24; border-color: #2E7D32; color: #81C784; }
html[data-theme="dark"] .vfile-d { background: #3a1e22; border-color: #C62828; color: #EF9A9A; }

/* 🛠️ 2026-09-01 系统体检异常：左侧栏跳动红提醒（fail>0 或 warn>0 时触发） */
@keyframes hxDiagPulse {
  0%, 100% { background: rgba(231,76,60,0.25); box-shadow: 0 0 0 0 rgba(231,76,60,0.55); }
  50% { background: rgba(231,76,60,0.85); box-shadow: 0 0 14px 4px rgba(231,76,60,0.45); }
}
.hx-nav-item.diag-alert {
  animation: hxDiagPulse 1.2s ease-in-out infinite;
  border-radius: 8px;
  color: #fff !important;
}

/* 🛠️ 2026-09-01 王总：顶栏快捷待办胶囊（有事项显示+闪动，无事项整组隐藏，点击直达页面） */
/* 🛠️ 2026-09-01 v2.7.468 王总：胶囊移出顶栏改 fixed 视口居中——顶栏 left 随侧边栏折叠/hover 滑动时胶囊不再跟着跑 */
#topbarQuick {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 44px;
  z-index: 1002;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  pointer-events: none;
}
#topbarQuick > * { pointer-events: auto; }
@media (max-width: 768px) {
  #topbarQuick {
    position: fixed;
    top: 48px;
    right: 8px;
    left: auto;
    transform: none;
    height: auto;
    z-index: 1002;
    justify-content: flex-end;
    margin: 0;
  }
}
.hx-topbar-quick {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 10px;
}
.hx-topbar-quick-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: linear-gradient(135deg, #E74C3C, #C0392B);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 18px;
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(231,76,60,.35);
  animation: hxDiagPulse 1.2s ease-in-out infinite;
  transition: transform .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  line-height: 1;
}
.hx-topbar-quick-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(231,76,60,.55);
}
.hx-topbar-quick-item:active { transform: translateY(0); }
.hx-topbar-quick-ico { font-size: 0.875rem; }
.hx-topbar-quick-num {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(255,255,255,.3);
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
@media (max-width: 768px) {
  .hx-topbar-quick { gap: 5px; margin: 0 4px; justify-content: flex-end; }
  .hx-topbar-quick-item { padding: 4px 9px; font-size: 0.6875rem; gap: 4px; }
  .hx-topbar-quick-num { min-width: 15px; height: 15px; padding: 0 4px; font-size: 0.625rem; }
}

/* ===== 侧边栏折叠（v2.7.467 王总：电脑端可收起成图标窄栏） ===== */
.hx-sidebar { transition: width .25s ease, min-width .25s ease; }
.hx-topbar { transition: left .25s ease; }
.hx-sb-footer {
  flex-shrink: 0;
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hx-sb-toggle {
  width: 100%;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: var(--text-sidebar);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  overflow: hidden;
}
.hx-sb-toggle:hover { background: rgba(255,255,255,0.18); color: var(--text-light); }

/* 折叠态：收成 64px 只留图标 */
body.sb-collapsed { --sidebar-width: 64px; }
body.sb-collapsed .hx-sidebar-header h1,
body.sb-collapsed .hx-sidebar-header .hx-subtitle { display: none; }
body.sb-collapsed .hx-sidebar-header > div { justify-content: center; }
body.sb-collapsed .hx-nav-group { display: none; }
body.sb-collapsed .hx-nav-item {
  font-size: 0;
  justify-content: center;
  padding: 10px 0;
}
body.sb-collapsed .hx-nav-item .hx-nav-icon {
  font-size: 1.0625rem;
  margin-right: 0;
}
body.sb-collapsed .hx-nav-item .hx-nav-badge { position: absolute; top: 2px; right: 4px; margin-left: 0; }
body.sb-collapsed .hx-nav-item { position: relative; }

/* hover 临时展开（顶栏联动靠 sb-hover 改变量） */
body.sb-collapsed.sb-hover { --sidebar-width: 220px; }
body.sb-collapsed.sb-hover .hx-sidebar-header h1,
body.sb-collapsed.sb-hover .hx-sidebar-header .hx-subtitle { display: block; }
body.sb-collapsed.sb-hover .hx-sidebar-header > div { justify-content: center; }
body.sb-collapsed.sb-hover .hx-nav-group { display: block; }
body.sb-collapsed.sb-hover .hx-nav-item {
  font-size: 0.8125rem;
  justify-content: flex-start;
  padding: 10px var(--spacing-md);
}
body.sb-collapsed.sb-hover .hx-nav-item .hx-nav-icon {
  font-size: 1rem;
  margin-right: var(--spacing-sm);
}

/* 手机端：忽略折叠态（已有汉堡逻辑） */
@media (max-width: 768px) {
  body.sb-collapsed { --sidebar-width: 220px; }
  body.sb-collapsed.sb-hover { --sidebar-width: 220px; }
  .hx-sb-footer { display: none; }
}

/* 🛠️ 2026-09-04 v2.7.517 全局表格长文本省略（王总定：长了自动…，鼠标悬停看全名）
   配合 00-core.js 末尾自动打标逻辑使用：只对长文本格生效，操作格/短文本格/数字格不处理 */
.hx-cell-ellipsis{max-width:240px;overflow:hidden;}
.hx-cell-ellipsis .hx-ell-inner{display:block;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* 🛠️ 2026-09-04 v2.7.518 p0 运费表紧凑版（王总批 v2 布局）
   低频列收进 ▶ 展开详情行；单号/提交时间弱化（fx-dim）平时不显眼、悬停看全 */
#freightTable { table-layout: fixed; }
#freightTable thead th { padding: 6px 8px; line-height: 1.3; }
#freightTable td { padding: 5px 8px; vertical-align: middle; line-height: 1.35; }
#freightTable th.fx-dim-th { color: var(--text-muted); font-weight: 500; }
#freightTable td.fx-dim { color: var(--text-muted); }
#freightTable tr:hover td.fx-dim { color: var(--text-secondary); }
#freightTable .fx-mono { font-family: var(--font-mono); font-size: 0.6875rem; white-space: nowrap; }
#freightTable .fx-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#freightTable .fx-num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
/* 🛠️ 2026-09-04 v2.7.520 王总：主表单元格字号全部统一 0.75rem——125%大字档下 fx-mono/fx-dim 缩成 11px 大小不一 */
#freightTable tbody tr:not(.fx-detail-row) td { font-size: 0.75rem !important; }
#freightTable tbody tr:not(.fx-detail-row) td * { font-size: 0.75rem !important; }
#freightTable tbody tr:not(.fx-detail-row) td.fx-mono,
#freightTable tbody tr:not(.fx-detail-row) td.fx-num { font-size: 0.75rem !important; }
/* 🛠️ 2026-09-04 v2.7.520 中屏降档（≤1359px 桌面内容区不足 1000px）：整表统一缩至 0.6875rem，保持 18 列完整不溢出 */
@media (max-width: 1359px) and (min-width: 769px) {
  #freightTable thead th,
  #freightTable tbody tr:not(.fx-detail-row) td,
  #freightTable tbody tr:not(.fx-detail-row) td.fx-mono,
  #freightTable tbody tr:not(.fx-detail-row) td.fx-num,
  #freightTable tbody tr:not(.fx-detail-row) td * { font-size: 0.6875rem !important; }
}
#freightTable .fx-fexp { cursor: pointer; display: inline-block; width: 14px; text-align: center; color: #8FA3C0; font-size: 0.625rem; user-select: none; margin-right: 4px; transition: transform 0.15s; }
#freightTable tbody tr.fx-detail-row td { padding: 0 !important; background: var(--table-stripe, #F6F9FD); }
#freightTable .fx-detail-inner { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: flex-start; padding: 9px 14px 9px 74px; font-size: 0.75rem; }
#freightTable .fx-detail-inner .fx-chip > span { display: block; color: #9AA7BD; font-size: 0.625rem; margin-bottom: 2px; }
#freightTable .fx-detail-inner .fx-chip > b { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
#freightTable .fx-detail-inner .fx-chip > b.fx-mono { font-size: 0.6875rem; }
#freightTable .fx-ops { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; }

/* 🛠️ 2026-09-04 v2.7.519 p0运费表手机适配（王总批方案A）：窄屏精简核心列，低频字段收进▶详情
   桌面(≥769px)：fx-mo 详情字段/表头短词隐藏；手机(≤768px)：隐藏单号/提交时间/驾驶员/车牌/吨位/客户收入/客户 7列，剩7列重排 */
.fx-chip.fx-mo { display: none; }
.fx-th-short { display: none; }
@media (max-width: 768px) {
  /* v2.7.520 王总 18列主表 → 手机只留 勾选/日期/驾驶员/项目/车牌/状态，装料/卸料/货物/车次/吨位/成本单价/成本金额/结算单价/客户收入/加班/请假/客户 12列隐藏进▶详情补齐（fx-mo） */
  #freightTable thead th:nth-child(6), #freightTable thead th:nth-child(7), #freightTable thead th:nth-child(8),
  #freightTable thead th:nth-child(9), #freightTable thead th:nth-child(10), #freightTable thead th:nth-child(11),
  #freightTable thead th:nth-child(12), #freightTable thead th:nth-child(13), #freightTable thead th:nth-child(14),
  #freightTable thead th:nth-child(15), #freightTable thead th:nth-child(16), #freightTable thead th:nth-child(17) { display: none; }
  #freightTable tbody td:nth-child(6), #freightTable tbody td:nth-child(7), #freightTable tbody td:nth-child(8),
  #freightTable tbody td:nth-child(9), #freightTable tbody td:nth-child(10), #freightTable tbody td:nth-child(11),
  #freightTable tbody td:nth-child(12), #freightTable tbody td:nth-child(13), #freightTable tbody td:nth-child(14),
  #freightTable tbody td:nth-child(15), #freightTable tbody td:nth-child(16), #freightTable tbody td:nth-child(17) { display: none; }
  #freightTable thead th { font-size: 0.6875rem !important; letter-spacing: 0 !important; padding: 6px 3px !important; }
  #freightTable thead th:nth-child(1) { width: 7% !important; }
  #freightTable thead th:nth-child(2) { width: 16% !important; }
  #freightTable thead th:nth-child(3) { width: 14% !important; }
  #freightTable thead th:nth-child(4) { width: 24% !important; }
  #freightTable thead th:nth-child(5) { width: 18% !important; }
  #freightTable thead th:nth-child(18) { width: 21% !important; }
  #freightTable tbody td { padding: 5px 3px !important; }
  #freightTable tbody td:first-child span[data-batch] { display: none; }
  #freightTable tbody td:first-child .fx-fexp { margin-right: 2px; }
  #freightTable tbody td:nth-child(18) > span { padding: 1px 4px !important; border-radius: 6px !important; font-size: 0.6875rem !important; }
  #freightTable .fx-detail-inner { padding-left: 12px !important; gap: 5px 14px; }
  .fx-chip.fx-mo { display: block; }
  #freightTable .fx-chip-wide { flex: 1 1 100%; }
}
