/**
 * FastQuote 寰宇货代 - 公共布局样式
 * 所有页面通过 HTML注入中间件自动引入
 */

/* ==================== 字体（本地引入，不依赖 Google CDN） ==================== */
/* Material Symbols Outlined 字体通过 material-symbols.css 本地引入 */
/* Noto Sans SC / Plus Jakarta Sans fallback 到系统 sans-serif */

/* ==================== 基础重置 ==================== */
html {
  width: 100% !important;
  height: auto !important;
  overflow-x: hidden !important;
  position: relative;
}

body {
  margin: 0;
  font-family: 'Noto Sans SC', sans-serif;
  background: #f7f9fb;
  -webkit-font-smoothing: antialiased;
}

/* ==================== Material Symbols ==================== */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  transition: font-variation-settings 0.2s ease;
}

.nav-item:hover .material-symbols-outlined,
.active-nav-item .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==================== 侧边栏滚动条 ==================== */
.custom-scrollbar::-webkit-scrollbar,
.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track,
.sidebar-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.custom-scrollbar::-webkit-scrollbar-thumb,
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* ==================== 玻璃边框 ==================== */
.glass-border {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==================== 中台侧边栏 active 状态 ==================== */
.active-nav-item {
  position: relative;
}
.active-nav-item .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* ==================== 前台侧边栏 active 状态 ==================== */
.nav-item-active {
  background-color: rgba(178, 247, 70, 0.1);
  color: #b2f746 !important;
  border-left: 4px solid #A3E635;
}
.nav-item-active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==================== 顶部栏角标 ==================== */
.active-icon-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background-color: #ba1a1a;
  border-radius: 50%;
  border: 2px solid white;
}

/* ==================== 内容区布局（统一强制，覆盖各页面自定义样式） ==================== */
/* 登录页使用 .login-main 类，不受全局 main 规则影响 */
main:not(.login-main) {
  margin-left: 260px !important;
  padding-top: 64px !important;
  padding-bottom: 80px !important;
  min-height: 100vh !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  overflow: visible !important;
  flex: none !important;
  display: block !important;
}

/* page-header 标题栏：和内容区域同宽，靠 px-gutter 对齐 */
.page-header-component {
  border-radius: 0 !important;
}

/* ==================== 通用卡片样式 ==================== */
.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(6, 38, 27, 0.04);
}

.stat-num {
  font-size: 32px;
  font-weight: 700;
  color: #06261b;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* ==================== 表格通用样式 ==================== */
.fq-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(6, 38, 27, 0.04);
}
.fq-table th {
  background: #f2f4f6;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fq-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #1A2E28;
  border-top: 1px solid #e5e7eb;
}
.fq-table tr:hover td {
  background: #f9fafb;
}

/* ==================== 按钮通用样式 ==================== */
.fq-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.fq-btn-primary {
  background: #06261b;
  color: #fff;
}
.fq-btn-primary:hover {
  opacity: 0.9;
}
.fq-btn-secondary {
  background: #f2f4f6;
  color: #1A2E28;
}
.fq-btn-secondary:hover {
  background: #e6e8ea;
}
.fq-btn-danger {
  background: #ba1a1a;
  color: #fff;
}
.fq-btn-danger:hover {
  opacity: 0.9;
}

/* ==================== 状态标签 ==================== */
.fq-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}
.fq-badge-success { background: rgba(0, 169, 122, 0.1); color: #00A97A; }
.fq-badge-warning { background: rgba(255, 107, 61, 0.1); color: #FF6B3D; }
.fq-badge-error { background: rgba(186, 26, 26, 0.1); color: #ba1a1a; }
.fq-badge-info { background: rgba(70, 101, 87, 0.1); color: #466557; }
.fq-badge-default { background: #f2f4f6; color: #64748b; }

/* ==================== 输入框通用样式 ==================== */
.fq-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #c1c8c3;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.fq-input:focus {
  border-color: #00A97A;
  box-shadow: 0 0 0 2px rgba(0, 169, 122, 0.1);
}

/* ==================== 分页样式 ==================== */
.fq-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 16px;
}
.fq-pagination button {
  padding: 6px 12px;
  border: 1px solid #c1c8c3;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #1A2E28;
}
.fq-pagination button:hover {
  background: #f2f4f6;
}
.fq-pagination button.active {
  background: #06261b;
  color: #fff;
  border-color: #06261b;
}
.fq-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==================== 弹窗样式 ==================== */
.fq-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.fq-modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.fq-modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: #06261b;
  margin: 0 0 16px;
}

/* ==================== 客户登录预警 ==================== */
.fq-alert-overlay, .fq-alert-overlay * { box-sizing: border-box; }
.fq-alert-svg { display: block; flex: none; width: 24px; height: 24px; }
.fq-alert-header-icon .fq-alert-svg { width: 29px; height: 29px; }
.fq-alert-action .fq-alert-svg, .fq-alert-footer .fq-alert-svg { width: 16px; height: 16px; }
.fq-alert-close .fq-alert-svg { width: 20px; height: 20px; }
.fq-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 38, 27, .52);
  backdrop-filter: blur(3px);
}
.fq-alert-panel {
  width: min(760px, 100%);
  max-height: min(86vh, 780px);
  max-height: min(86dvh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 22px;
  background: #f7f9f8;
  box-shadow: 0 30px 90px rgba(6, 38, 27, .28);
}
.fq-alert-header {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 24px 70px 22px 26px;
  color: #fff;
  background: linear-gradient(128deg, #06261b 0%, #0b4935 100%);
}
.fq-alert-header::after {
  content: '';
  position: absolute;
  right: 92px;
  bottom: -44px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(163, 230, 53, .08);
  pointer-events: none;
}
.fq-alert-header-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(163, 230, 53, .34);
  border-radius: 16px;
  color: #c7f36a;
  background: rgba(163, 230, 53, .12);
}
.fq-alert-header-icon .material-symbols-outlined { font-size: 29px; }
.fq-alert-heading { min-width: 0; position: relative; z-index: 1; }
.fq-alert-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #c7f36a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}
.fq-alert-heading h3 { margin: 0; color: #fff; font-size: 22px; font-weight: 800; }
.fq-alert-heading p { margin: 5px 0 0; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.5; }
.fq-alert-count {
  position: relative;
  z-index: 1;
  min-width: 74px;
  padding: 9px 13px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}
.fq-alert-count strong { display: block; color: #c7f36a; font-size: 22px; line-height: 1; }
.fq-alert-count span { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 10px; }
.fq-alert-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: rgba(255,255,255,.76);
  background: rgba(255,255,255,.09);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.fq-alert-close:hover { color: #fff; background: rgba(255,255,255,.18); }
.fq-alert-close .material-symbols-outlined { font-size: 20px; }
.fq-alert-list {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  overflow-y: auto;
}
.fq-alert-item {
  display: grid;
  grid-template-columns: 28px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--alert-border) 32%, #e4e9e7);
  border-left: 4px solid var(--alert-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(6, 38, 27, .045);
}
.fq-alert-index { color: #8a9993; font-size: 12px; font-weight: 800; text-align: center; }
.fq-alert-item-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--alert-icon);
  background: var(--alert-bg);
}
.fq-alert-item-icon .material-symbols-outlined { font-size: 23px; }
.fq-alert-copy { min-width: 0; }
.fq-alert-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; color: #8a9993; font-size: 10px; font-weight: 700; }
.fq-alert-meta span:first-child { color: var(--alert-text); }
.fq-alert-copy p { margin: 0; color: #1a2e28; font-size: 14px; font-weight: 650; line-height: 1.55; overflow-wrap: anywhere; }
.fq-alert-item-action { min-width: 104px; text-align: right; }
.fq-alert-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--alert-color) 58%, #fff);
  border-radius: 10px;
  color: var(--alert-color);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.fq-alert-action:hover { transform: translateY(-1px); background: var(--alert-bg, #f7f9f8); box-shadow: 0 5px 12px rgba(6,38,27,.08); }
.fq-alert-action .material-symbols-outlined { font-size: 16px; }
.fq-alert-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8e5;
  background: #fff;
}
.fq-alert-footer p { display: flex; align-items: center; gap: 7px; margin: 0; color: #64746e; font-size: 11px; }
.fq-alert-footer p .material-symbols-outlined { color: #16845b; font-size: 16px; }
.fq-alert-footer button {
  flex: none;
  min-width: 126px;
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  color: #c7f36a;
  background: #06261b;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
@media (max-width: 640px) {
  .fq-alert-overlay { align-items: flex-end; padding: 10px; }
  .fq-alert-panel { max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 14px 14px; }
  .fq-alert-header { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 20px 52px 18px 18px; }
  .fq-alert-header-icon { width: 44px; height: 44px; border-radius: 13px; }
  .fq-alert-heading h3 { font-size: 19px; }
  .fq-alert-heading p { font-size: 12px; }
  .fq-alert-count { display: none; }
  .fq-alert-close { top: 14px; right: 12px; }
  .fq-alert-list { padding: 12px; }
  .fq-alert-item { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 13px; }
  .fq-alert-index { display: none; }
  .fq-alert-item-icon { width: 38px; height: 38px; }
  .fq-alert-item-action { grid-column: 2; min-width: 0; text-align: left; }
  .fq-alert-action { width: 100%; }
  .fq-alert-footer { padding: 12px; }
  .fq-alert-footer p { display: none; }
  .fq-alert-footer button { width: 100%; }
}

/* ==================== Toast 通知 ==================== */
.fq-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 12px 24px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: fq-toast-in 0.3s ease;
}
@keyframes fq-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
  main:not(.login-main) {
    margin-left: 0 !important;
  }
  header.fixed {
    left: 0 !important;
  }
  footer.fixed:not([data-custom-footer]) {
    position: static !important;
    left: auto !important;
    right: auto !important;
  }
  #fq-mobile-menu-button {
    display: inline-flex !important;
  }
  aside {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  aside.show {
    transform: translateX(0);
  }
}

/* ========================================================================
   FQ 表格系统 v2 — 统一列宽自适应 + 图标操作按钮 + 统一分页
   使用方式：给 <table> 加 class="fq-tbl" 即可启用全部能力
   ======================================================================== */

/* ---- 列宽自适应：table-layout:fixed + colgroup 比例分配 ---- */
.fq-tbl {
  width: 100% !important;
  border-collapse: collapse;
  table-layout: fixed;             /* 关键：启用固定布局，列宽由 colgroup 控制 */
  background: #fff;
  display: table !important;       /* 显式声明 display:table，防止被其他 CSS 覆盖为 block 导致竖向排列 */
}
.fq-tbl thead { display: table-header-group !important; }
.fq-tbl tbody { display: table-row-group !important; }
.fq-tbl tr { display: table-row !important; }
.fq-tbl td { display: table-cell !important; }
.fq-tbl th {
  background: #f2f4f6;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 对齐修正：.fq-tbl th 的 text-align:left 优先级高于页面上的 text-center/text-right，
   需按类名显式放行，否则表头永远左对齐、与列内容错位 */
.fq-tbl th.text-center { text-align: center; }
.fq-tbl th.text-right  { text-align: right; }
.fq-tbl th.text-left   { text-align: left; }
.fq-tbl td {
  padding: 14px 16px;
  font-size: 14px;
  color: #1A2E28;
  border-top: 1px solid #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;   /* 垂直居中：修复表头与内容、图标按钮与同行文字不在一条水平线 */
}
.fq-tbl tr:hover td {
  background: #f9fafb;
}
/* 允许某些列内容换行/完整展示（加 .fq-cell-wrap 到 td 上） */
.fq-tbl td.fq-cell-wrap {
  white-space: normal;
  word-break: break-word;
  overflow: visible;    /* 覆盖 td 默认 overflow:hidden，防按钮等内容被裁剪 */
}
/* 空行/暂无数据行（带 colspan 的 td）自动居中 */
.fq-tbl td[colspan] {
  text-align: center !important;
}
/* 货物明细行同时有 colspan 和 fq-cell-wrap 时，左对齐以支持 flex-wrap 自适应布局 */
.fq-tbl td[colspan].fq-cell-wrap {
  text-align: left !important;
}

/* ---- 筛选区统一图标按钮（重置/刷新等，纯图标方钮） ----
   使用方式：<button class="fq-icon-btn" title="重置"><span class="material-symbols-outlined text-[18px]">restart_alt</span></button>
*/
.fq-icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c1c8c3; /* outline-variant */
  border-radius: 0.5rem;
  background: #fff;
  color: #475556; /* text-text-secondary */
  cursor: pointer;
  flex: none;
  transition: background-color 0.2s, color 0.2s;
}
.fq-icon-btn:hover {
  background: #f0f2f1; /* surface-container-low */
  color: #06261b; /* text-primary */
}
.fq-icon-btn .material-symbols-outlined {
  font-size: 18px;
}

/* ---- 邮箱导出按钮（公共导出组件，配合 FQ.showSendDataModal 使用） ----
   使用方式：<button class="fq-export-btn" onclick="exportList()"><span class="material-symbols-outlined text-[18px]">outgoing_mail</span>邮箱导出</button>
*/
.fq-export-btn {
  height: 2.5rem;
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #c1c8c3; /* outline-variant */
  border-radius: 0.5rem;
  background: #fff;
  color: #06261b; /* text-primary */
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex: none;
  transition: background-color 0.2s;
}
.fq-export-btn:hover {
  background: #f0f2f1; /* surface-container-low */
}
.fq-export-btn .material-symbols-outlined {
  font-size: 18px;
}

/* ---- 图标操作按钮组 ---- */
.fq-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}
.fq-actions .fq-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  position: relative;
}
.fq-actions .fq-act .material-symbols-outlined {
  font-size: 20px;
}
.fq-actions .fq-act:hover {
  background: #f2f4f6;
  color: #06261b;
}
.fq-actions .fq-act.fq-act-primary:hover { background: rgba(0,169,122,0.1); color: #00A97A; }
.fq-actions .fq-act.fq-act-danger:hover  { background: rgba(186,26,26,0.1); color: #ba1a1a; }
.fq-actions .fq-act.fq-act-warn:hover   { background: rgba(255,107,61,0.1); color: #FF6B3D; }

/* "更多"下拉触发按钮 */
.fq-actions .fq-act-more {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.fq-actions .fq-act-more:hover {
  background: #f2f4f6;
  color: #06261b;
}
.fq-actions .fq-act-more .material-symbols-outlined {
  font-size: 20px;
}

/* 下拉菜单容器 */
.fq-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  padding: 4px 0;
  min-width: 160px;
  z-index: 100;
  display: none;
}
.fq-dropdown.open { display: block; }
.fq-dropdown .fq-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #1A2E28;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease;
}
.fq-dropdown .fq-dropdown-item:hover {
  background: #f2f4f6;
}
.fq-dropdown .fq-dropdown-item .material-symbols-outlined {
  font-size: 18px;
  color: #64748b;
}
.fq-dropdown .fq-dropdown-item.danger { color: #ba1a1a; }
.fq-dropdown .fq-dropdown-item.danger .material-symbols-outlined { color: #ba1a1a; }

/* 操作列宽度固定 */
.fq-tbl .fq-col-actions {
  width: 140px;       /* 默认操作列宽度，页面可按按钮数量微调 */
  text-align: right;
}

/* 操作列：允许 tooltip 浮出，不受 td overflow:hidden 裁剪 */
.fq-tbl td.fq-col-actions,
.fq-tbl td:has(.fq-actions) {
  overflow: visible;
}

/* ---- 统一分页 ---- */
.fq-pager,
.fq-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid #e5e7eb;
  background: #fafbfc;
}
.fq-pager-info,
.fq-pg-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #64748b;
}
/* 每页条数选择器容器 */
.fq-pg-sizer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #64748b;
  order: 2;                     /* 条数选择器在分页按钮左侧 */
  margin-left: auto;            /* 吸收剩余空间，和分页按钮一起靠右 */
}
/* 每页条数选择器 */
.fq-pg-size {
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  color: #1A2E28;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.fq-pg-size:focus {
  border-color: #00A97A;
}
.fq-pager-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  order: 3;                     /* 分页按钮在条数选择器右侧 */
  margin-left: 12px;            /* 紧挨条数选择器右侧 */
}
.fq-pager-btns button {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1A2E28;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fq-pager-btns button:hover:not(.active):not(:disabled) {
  background: #f2f4f6;
  border-color: #c1c8c3;
}
.fq-pager-btns button.active {
  background: #06261b;
  color: #fff;
  border-color: #06261b;
  font-weight: 600;
}
.fq-pager-btns button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.fq-pager-btns button .material-symbols-outlined {
  font-size: 20px;
}

/* ---- 操作按钮 tooltip 功能提示 ---- */
.fq-actions .fq-act[data-tip]::after,
.fq-actions .fq-act-more[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #06261b;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  line-height: 1.4;
}
.fq-actions .fq-act[data-tip]::before,
.fq-actions .fq-act-more[data-tip]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #06261b;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 200;
}
.fq-actions .fq-act[data-tip]:hover::after,
.fq-actions .fq-act[data-tip]:hover::before,
.fq-actions .fq-act-more[data-tip]:hover::after,
.fq-actions .fq-act-more[data-tip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.fq-actions .fq-act[data-tip]:hover::after {
  transform: translateX(-50%) translateY(-2px);
}

/* ========================================================================
   FQ 表格 — 鼠标悬停复制按钮
   使用方式：在 renderRow 中调用 FQTable.copyable(text, displayHtml)
   ======================================================================== */
.fq-copy-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}
.fq-copy-cell .fq-copy-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fq-copy-btn {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  padding: 0;
}
.fq-copy-cell:hover .fq-copy-btn {
  opacity: 1;
}
.fq-copy-btn:hover {
  background: #e6e8ea;
  color: #06261b;
}
.fq-copy-btn .material-symbols-outlined {
  font-size: 13px;
  line-height: 1;
}
.fq-copy-btn.copied {
  color: #00A97A;
  opacity: 1;
}
.fq-copy-btn.copied .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* ==================== page-header 间距修正 ==================== */

/* 全站公告位于固定导航下方，占据文档流，不覆盖表单。 */
.fq-announcement-bar {
  position: sticky;
  top: 64px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 7px 24px;
  border-bottom: 1px solid #cbd5e1;
  background: #edf7ff;
  color: #14304a;
  font-size: 13px;
}
.fq-announcement-warning { background: #fff7e5; color: #7a4300; border-color: #f2d28a; }
.fq-announcement-critical { background: #fff0ee; color: #8a1b16; border-color: #f0b4ae; }
.fq-announcement-badge { flex: none; white-space: nowrap; }
.fq-announcement-text { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fq-announcement-bar button { flex: none; color: inherit; font-weight: 700; text-decoration: underline; }
.fq-announcement-bar .fq-announcement-close { text-decoration: none; font-size: 22px; line-height: 1; padding: 0 4px; }
.fq-announcement-overlay { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .45); }
.fq-announcement-panel { width: min(620px, 100%); max-height: min(80vh, 740px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, .2); padding: 22px; }
.fq-announcement-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fq-announcement-panel-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.fq-announcement-panel-head button, .fq-announcement-entry a { color: #07573c; font-weight: 700; }
.fq-announcement-entry { padding: 16px 0; border-top: 1px solid #e2e8f0; }
.fq-announcement-entry h3 { font-size: 16px; font-weight: 700; margin: 0 0 3px; }
.fq-announcement-entry small { color: #64748b; }
.fq-announcement-entry p { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
@media (max-width: 768px) {
  .fq-announcement-bar { padding: 8px 12px; gap: 8px; }
  .fq-announcement-text { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
}

/* 确保 page-header 紧贴顶部导航栏，无额外间距 */
.page-header-component {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 客户端窄屏：页眉和询价表单按设备宽度排版，业务类型保留横向滚动。 */
@media (max-width: 768px) {
  header.fixed { padding-left: 12px !important; padding-right: 12px !important; }
  header.fixed > div:first-child { min-width: 0; }
  header.fixed > div:last-child { gap: 6px !important; }
  header.fixed > div:last-child > button { padding: 4px !important; }
  header.fixed > div:last-child > div:not(#user-dropdown-wrapper) { margin-left: 0 !important; margin-right: 0 !important; }
  #user-dropdown-wrapper > button { gap: 4px !important; padding-right: 4px !important; }
  #user-dropdown-wrapper > button > div:first-child { min-width: 0; }
  #user-dropdown-wrapper > button > div:first-child > span:first-child { display: block; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #user-dropdown-wrapper > button > div:nth-child(2) { width: 32px !important; height: 32px !important; flex: none; }
  #user-dropdown-wrapper > button > span:last-child { display: none; }
  .page-header-component > header { height: auto !important; min-height: 80px; flex-wrap: wrap !important; padding-top: 12px; padding-bottom: 12px; }
  .page-header-component > header > div:first-child { min-width: 0; width: 100%; }
  .page-header-component > header > div:first-child nav { min-width: 0; flex-wrap: wrap; font-size: 14px; }
  .page-header-component > header > div:last-child { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .mode-tabs { max-width: 100%; overflow-x: auto; flex: none; }
  .mode-tabs > button { flex: none; white-space: nowrap; padding-left: 12px !important; padding-right: 12px !important; }
  .cargo-item > div:first-child { flex-wrap: wrap; gap: 8px; }
  .cargo-item > div:first-child > div:first-child { min-width: 0; }
  .cargo-item > div:first-child > div:first-child > span:last-child { overflow-wrap: anywhere; }
  #country-tab-group > button { white-space: nowrap; padding-left: 8px !important; padding-right: 8px !important; }
  section > div:first-child:has(#country-tab-group) { flex-wrap: wrap; gap: 8px; }
  section > div:first-child:has(#country-tab-group) h3 { font-size: 16px; line-height: 1.3; }
}
