/* ============================================================
 * 悦点进销存 Web 版 · 全站列表页【唯一公共视觉样式源】(css/pages/list-theme.css)
 * ------------------------------------------------------------
 * 20261116ah：全站所有「列表 + 查询」主视图的查询卡 / 按钮条 / 列表卡 / 表格 /
 *   分页控件视觉，全部集中在本文件。以后改风格只改这一处，全站一起变。
 *
 * 【这是唯一维护点】
 *   · 所有颜色 / 圆角 / 玻璃 / 阴影参数 → 顶部 :root 的 --lv-* 变量（改一处即全站生效）
 *   · 视觉规则的选择器统一走 .lv-page 作用域；采购订单试点已不再用 orders.css 的
 *     .pt-merge 视觉规则（那份已删除），与其它列表页共用本文件。
 *   · 由 core/utils.js 的 WB.applyListStyle() 在视图挂载 / 异步渲染后幂等打标：
 *       .lv-page（视图根） .lv-query（查询卡） .lv-acts（按钮条） .lv-card（列表卡）
 *       不碰录入页 / 弹窗 / 报表 / 台账。
 *
 * 【按钮条三种 DOM 形态，统一打 .lv-acts】
 *   1) splitTools 拆出的 .bar-acts            （多数单据页）
 *   2) 采购订单独立 .pt-merge-acts             （在 .page-head 外，与 card 同层）
 *   3) orders.js order/spreorder 的 .pt-row.pt-acts（查询卡内部的子行）
 * ============================================================ */

:root {
  /* 查询卡淡蓝渐变（覆盖在页面底色上，渲染出与表头一致的淡蓝） */
  --lv-query-bg: linear-gradient(180deg, rgba(22, 119, 255, .13) 0%, rgba(22, 119, 255, .10) 100%);
  /* 按钮条深蓝玻璃渐变（比查询卡深，形成「查询淡 → 按钮深 → 表头淡」层次） */
  --lv-acts-bg: linear-gradient(180deg, rgba(22, 119, 255, .38) 0%, rgba(22, 119, 255, .24) 100%);
  /* 列表卡玻璃渐变（极淡蓝到近白） */
  --lv-card-bg: linear-gradient(180deg, rgba(22, 119, 255, .05) 0%, rgba(255, 255, 255, .45) 100%);
  /* 青蓝细边（玻璃轮廓关键，不是实心品牌蓝） */
  --lv-edge: 1px solid rgba(22, 130, 200, .32);
  /* 毛玻璃参数 */
  --lv-blur: blur(10px) saturate(1.2);
  /* 顶部内高光（查询卡/按钮条用 .8，列表卡用较柔的 .6） */
  --lv-gloss: inset 0 1px 0 rgba(255, 255, 255, .8);
  --lv-gloss-card: inset 0 1px 0 rgba(255, 255, 255, .6);
  /* 大圆角（20261116aj：14px → 8px，列表卡圆角减少一点） */
  --lv-radius: 8px;
  /* 查询卡圆角（20261116aj：直角 → 4px 一点点小圆角） */
  --lv-radius-q: 4px;
  /* 表头淡蓝底：20261117au 用户指定统一为 #EDF4FF（实色，避免叠在玻璃卡渐变上偏色） */
  --lv-head-bg: #EDF4FF;
  /* 数据行白底 / hover 灰 / 选中蓝 */
  --lv-row-bg: #fff;
  --lv-row-hover: rgba(0, 0, 0, .05);
  --lv-row-sel: rgba(22, 119, 255, .12);
  /* 网格线（横竖统一灰） */
  --lv-grid: var(--line);
  /* 白底立体按钮 */
  --lv-btn-border: #c9d0da;
  --lv-btn-bg: linear-gradient(180deg, #fff 0%, #f4f6f9 100%);
  --lv-btn-bg-hover: linear-gradient(180deg, #eaf3ff 0%, #d5e6ff 100%);
}

/* ---------- 0. 内容区内边距：两卡贴近左上边缘 ---------- */
.content:has(.lv-page) { padding: 8px 8px 20px; }

/* ---------- 1. 查询条件卡：淡蓝玻璃 + 竖排标题 ---------- */
.lv-page .page-tools.lv-query {
  position: relative;
  padding: 13px 12px 13px 36px;
  background: var(--lv-query-bg);
  border: var(--lv-edge);
  /* 20261116ai：补回下边框（原 border-bottom:0 + 上圆角是为与按钮条无缝拼接，
     但采购订单结构里查询卡在 .page-head 内、按钮条在外，中间 4px 缝让下边框消失）。
     20261116aj：四角改一点点小圆角（--lv-radius-q=4px，不再是全直角）。 */
  border-bottom: var(--lv-edge);
  border-radius: var(--lv-radius-q);
  box-shadow: var(--lv-gloss);
  backdrop-filter: var(--lv-blur);
  -webkit-backdrop-filter: var(--lv-blur);
  margin-bottom: 0;
  /* tight.css 会把有相邻按钮条的查询行压成 inline-flex + fit-content；玻璃卡要求整宽铺满 */
  display: flex; width: 100%; max-width: 100%; margin-right: 0;
}
.lv-page .page-tools.lv-query:has(+ .bar-acts) { display: flex; width: 100%; max-width: 100%; margin-right: 0; }
/* 竖排「查询条件」标题：采购订单用真实 .pt-title，其余页用 ::before 伪元素，两者视觉参数一致 */
.lv-page .page-tools.lv-query::before,
.lv-page .pt-title {
  content: "查询条件";
  position: absolute; left: 6px; top: 50%; z-index: 2;
  transform: translateY(-50%);
  writing-mode: vertical-rl; text-orientation: upright; white-space: nowrap;
  height: 52px; width: auto;
  font-size: 11px; font-weight: 400; color: var(--brand, #1677ff);
  letter-spacing: 1px; line-height: 12px; padding: 3px 0;
  /* 20261117az：用户口径 —— 竖排「查询条件」不铺浅色底，只留蓝字本身 */
  background: none; border-radius: 0;
}
/* 采购订单已有真实 .pt-title，关掉查询卡伪元素标题，避免「查询条件」显示两次 */
.lv-page .page-tools.lv-query:has(.pt-title)::before { content: none; }
/* 20261117as：条内只有按钮、没有任何条件控件（如统计报表顶部「刷新/导出」）→ 不显示竖排「查询条件」，
   避免「标题写着查询条件、里面却没有条件可查」的错位感。有 input/select/textarea 的查询卡不受影响。
   20261117az：隐藏域不算可见查询条件 —— 数据迁移页工具条里只有一个 `<input type="file" hidden>`，
   原来被算作「有条件」，于是在页面上多印了「查询条件」四个字。改为排除 hidden 属性与 type=hidden。 */
.lv-page .page-tools.lv-query:not(:has(input:not([hidden]):not([type="hidden"]), select, textarea))::before { content: none; }
/* 同上且没有真实 .pt-title 时，左内边距回收到 12px（不留竖排标题的空白带） */
.lv-page .page-tools.lv-query:not(:has(.pt-title)):not(:has(input:not([hidden]):not([type="hidden"]), select, textarea)) { padding-left: 12px; }

/* ---------- 2. 操作按钮条：深蓝玻璃（三种 DOM 形态统一）---------- */
.lv-page .bar-acts.lv-acts,
.lv-page .pt-merge-acts.lv-acts {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin: 0;
  background: var(--lv-acts-bg);
  backdrop-filter: var(--lv-blur);
  -webkit-backdrop-filter: var(--lv-blur);
  border: var(--lv-edge);
  border-top: 0;
  border-bottom: 0;
  box-shadow: var(--lv-gloss);
  /* tight.css 把 .bar-acts 压成 fit-content；这里还原整宽铺满，与采购订单样板一致 */
  width: 100%; max-width: 100%; margin-right: 0;
}
/* 采购订单 .pt-merge-acts 在 .page-head 外、作为整块面板的「头」，保留上圆角+上边框（样板原样） */
.lv-page .pt-merge-acts.lv-acts {
  border-top: var(--lv-edge);
  border-radius: var(--lv-radius) var(--lv-radius) 0 0;
}
/* 采购订单查询卡包在 .page-head 内，query 卡与按钮条之间保留 4px 间隙（样板原样） */
.lv-page .page-head:has(> .page-tools.lv-query) { margin-bottom: 4px; }
/* orders.js order/spreorder tab：按钮条是查询卡内部的 .pt-row.pt-acts，做成卡内深蓝子条 */
.lv-page .page-tools.lv-query .pt-row.pt-acts.lv-acts {
  margin: 10px -12px -13px;
  padding: 10px 12px;
  /* 20261116aj：下沿跟随查询卡小圆角，避免内嵌深蓝子条的直角盖住查询卡底部圆角 */
  border-radius: 0 0 var(--lv-radius-q) var(--lv-radius-q);
  border: 0;
  border-top: var(--lv-edge);
}
/* 按钮全部左对齐 */
.lv-page .lv-acts .btn-add { margin-left: 0; padding-left: 0; }
.lv-page .lv-acts .btn-add::before { display: none; }

/* ---------- 3. 列表卡：玻璃面板 ---------- */
/* 直接命中 WB.applyListStyle 打上的 .lv-card：各模块查询区/卡片层级不一，兄弟选择器无法跨层命中 */
.lv-page .card.lv-card {
  border: var(--lv-edge);
  border-radius: var(--lv-radius);
  background: var(--lv-card-bg);
  backdrop-filter: var(--lv-blur);
  -webkit-backdrop-filter: var(--lv-blur);
  box-shadow: var(--lv-gloss-card), 0 2px 10px rgba(22, 119, 255, .06);
  margin-bottom: 12px;
}
/* 卡片前有查询区/按钮条：顶部无缝拼接（去上边 + 下圆角），与玻璃工具条连成一块面板 */
.lv-page .card.lv-card.lv-card-top-off {
  border-top: 0;
  border-radius: 0 0 var(--lv-radius) var(--lv-radius);
}

/* 20261117au：卡片与上方查询卡/按钮条「无缝拼接」时（lv-card-top-off），去掉表头自带的 1px 上边框。
   按钮条本身 border-bottom:0，这条灰线会被看成「按钮区和列表断开了」（用户截图的红色箭头处）。
   注意：只在 top-off 的卡上去掉，独立卡片（无上方工具条）仍保留表头上边框。 */
.lv-page .card.lv-card.lv-card-top-off .tbl > thead > tr > th { border-top: 0; }

/* ---------- 4. 表格：淡蓝表头黑字 / 白底数据行 / 统一灰网格 / hover 灰 / 选中蓝 ---------- */
.lv-page .card .tbl > thead > tr > th {
  background: var(--lv-head-bg);
  border-top: 1px solid var(--lv-grid);
  color: var(--t1, #1d2129);
}
.lv-page .card .tbl > tbody > tr { background: var(--lv-row-bg); }
.lv-page .card .tbl tbody tr:not(.sel):hover { background: var(--lv-row-hover); }
.lv-page .card .tbl tbody tr.sel,
.lv-page .card .tbl tbody tr.sel:hover { background: var(--lv-row-sel); }
.lv-page .card .tbl > tbody > tr > td { border-bottom: 1px solid var(--lv-grid); }
.lv-page .card .tbl > thead > tr > th,
.lv-page .card .tbl > tbody > tr > td { border-right: 1px solid var(--lv-grid); }
.lv-page .card .tbl > thead > tr > th:last-child,
.lv-page .card .tbl > tbody > tr > td:last-child { border-right: 0; }
/* 操作列按钮不折行 */
.lv-page .card .op-cell { white-space: nowrap; }
/* 自绘横向滚动条轨道在玻璃底上同步透明化（thumb 保持灰色） */
.lv-page .card .card-hscroll { background: rgba(238, 240, 243, .5); }
/* 表头 sticky 时背景需保留淡蓝（warehouse.css 的 .chk-wrap/.tfr-wrap 会设 #f7f8fa） */
.lv-page .chk-wrap .tbl thead th, .lv-page .tfr-wrap .tbl thead th { background: var(--lv-head-bg); }

/* ---------- 4b. 公共排序表头（20261117ap）----------
   label 左对齐 + hover 浮现的排序三角固定在「列最右边」+ 当前方向箭头贴三角左侧。
   三角/箭头绝对定位到 th 右侧，避开列宽手柄 .col-rz（right:0 / 宽 7px）：
   手柄 0~7px，三角 right:9px(宽16px => 9~25px)，箭头 right:23px(贴三角左侧)。 */
.sort-th { position: relative; padding-right: 40px !important; }
.sort-th .sh-label { vertical-align: middle; }
/* 方向箭头：仅当前排序列显示，贴在三角左侧 */
.sort-th .sort-arrow {
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  color: var(--brand, #1677ff); font-size: 10px; line-height: 1;
  margin: 0; vertical-align: middle; pointer-events: none;
}
.sort-th:not(.sorted) .sort-arrow { display: none; }
/* 排序三角：列最右边、默认淡显，hover 表头才清晰；点击弹正序/倒序菜单 */
.sort-th .sort-trigger {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin: 0; padding: 0;
  vertical-align: middle; cursor: pointer; border-radius: 3px;
  color: var(--t3, #86909c); opacity: .38;
  transition: opacity .12s, color .12s, background .12s;
}
.sort-th .sort-trigger svg { width: 11px; height: 11px; }
.sort-th:hover .sort-trigger,
.sort-th .sort-trigger:focus-visible,
.sort-th .sort-trigger.on { opacity: 1; }
.sort-th .sort-trigger:hover { color: var(--brand, #1677ff); background: rgba(22, 119, 255, .12); }
.sort-th .sort-trigger.on { color: var(--brand, #1677ff); }
/* 下拉菜单挂 body（fixed），避开表格 overflow 裁剪 */
.sort-menu {
  position: fixed; z-index: 320; min-width: 112px; padding: 4px;
  background: #fff; border: 1px solid var(--line, #e5e6eb); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(29, 33, 41, .16);
  animation: dlFadeIn .12s ease;
}
.sort-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px; border-radius: 4px; cursor: pointer;
  font-size: 12.5px; color: var(--t1, #1d2129); white-space: nowrap;
}
.sort-menu-item:hover { background: rgba(22, 119, 255, .08); color: var(--brand, #1677ff); }
.sort-menu-item.on { color: var(--brand, #1677ff); font-weight: 600; background: rgba(22, 119, 255, .06); }
.sort-menu-item .sm-ico { font-size: 13px; opacity: .8; }

/* ---------- 5. 白底按钮立体感（排除 primary/ok/danger 彩色按钮）---------- */
.lv-page .page-tools .btn:not(.btn-primary):not(.btn-ok):not(.btn-danger),
.lv-page .lv-acts .btn:not(.btn-primary):not(.btn-ok):not(.btn-danger) {
  border-color: var(--lv-btn-border);
  background: var(--lv-btn-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 1px 1px rgba(29, 33, 41, .10), 0 2px 5px rgba(29, 33, 41, .07);
}
.lv-page .page-tools .btn:not(.btn-primary):not(.btn-ok):not(.btn-danger):hover,
.lv-page .lv-acts .btn:not(.btn-primary):not(.btn-ok):not(.btn-danger):hover {
  color: var(--brand);
  border-color: rgba(22, 119, 255, .55);
  background: var(--lv-btn-bg-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 4px rgba(22, 119, 255, .18), 0 4px 10px rgba(22, 119, 255, .10);
}
.lv-page .page-tools .btn:not(.btn-primary):not(.btn-ok):not(.btn-danger):active,
.lv-page .lv-acts .btn:not(.btn-primary):not(.btn-ok):not(.btn-danger):active {
  box-shadow: inset 0 2px 3px rgba(29, 33, 41, .12);
  transform: translateY(1px);
}

/* ---------- 6. 分页控件：当前页输入框 + 蓝色循环刷新按钮（全局 .pager，凡调 bindPager 的列表页都有）---------- */
.pager .pg-refresh {
  flex: none; width: 28px; height: 28px; padding: 4px; margin-left: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #a9cdf5; border-radius: 6px;
  background: linear-gradient(180deg, #dceafb 0%, #cfe1f7 100%);
  color: var(--brand, #1677ff); cursor: pointer;
  transition: all .15s;
}
.pager .pg-refresh svg { width: 100%; height: 100%; pointer-events: none; }
/* 20261117an：hover 不再旋转图标，只给「被选中」的高亮态（边框加深 + 外圈蓝光 + 底色加深）；按下也不转动 */
.pager .pg-refresh:hover {
  border-color: var(--brand, #1677ff);
  background: linear-gradient(180deg, #cfe1f7 0%, #bcd6f4 100%);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, .18), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.pager .pg-refresh:active {
  background: linear-gradient(180deg, #bcd6f4 0%, #a9cdf5 100%);
  box-shadow: inset 0 2px 4px rgba(22, 119, 255, .25);
}
.pager .pg-jump {
  flex: none; width: 44px; height: 28px; padding: 0 4px; margin: 0;
  text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: var(--brand, #1677ff); background: #fff;
  border: 1px solid var(--brand, #1677ff); border-radius: 6px;
  outline: none; transition: border-color .15s;
}
.pager .pg-jump:hover { border-color: rgba(22, 119, 255, .75); }
.pager .pg-jump:focus { border-width: 2px; }

/* ---------- 7. 列宽拖拽手柄（20261117al）---------- */
/* 每个表头右边界一个窄命中区，hover 显示蓝色竖线 + 左右调整光标。
   手柄由 col-resize.js 动态插入 <span class=col-rz>，仅 .lv-page 主列表表格有。 */
.lv-page .card .tbl thead th > .col-rz {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 7px; cursor: col-resize; z-index: 3;
  margin: 0; padding: 0;
}
.lv-page .card .tbl thead th > .col-rz::after {
  content: ""; position: absolute; top: 4px; bottom: 4px; right: 2px;
  width: 2px; border-radius: 2px; background: transparent;
  transition: background .12s;
}
.lv-page .card .tbl thead th > .col-rz:hover::after,
.lv-page .card .tbl thead th > .col-rz.dragging::after {
  background: var(--brand, #1677ff);
}
/* 拖拽过程中禁止整页选中文本 / 强制左右光标 */
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
