/* ============ 库龄超一年产品清单（独立公网站点）· 视觉系统 ============
   样式与「墨西哥业绩看板」07 库存健康 · 超一年清单板块保持逐像素一致；
   本文件只保留该板块用到的规则（表格 / 筛选栏 / 商品图弹层 / 锁屏 / 加载遮罩）。 */
:root {
  --bg: #f2f6fd;
  --card: #ffffff;
  --ink: #1d2c51;
  --ink-2: #495c84;
  --ink-3: #6e80a6;
  --line: #e4eaf6;
  --blue: #2f6bf0;
  --teal: #0fa895;
  --navy: #1d2c51;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #8b5cf6;
  --up: #ef4444;      /* 涨（红涨） */
  --down: #12b76a;    /* 跌（绿跌） */
  --radius: 14px;
  --shadow: 0 2px 4px rgba(29,44,81,.04), 0 10px 28px rgba(29,44,81,.065);
  color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2F6BF0; outline-offset: 3px; }
.table-wrap:focus-visible { outline-offset: -3px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px; line-height: 1.55; min-width: 0;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(16,29,58,.18); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(47,107,240,.18); color: #1E4BD8; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(120deg, #2f6bf0 0%, #1e4bd8 100%); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.16); box-shadow: 0 3px 16px rgba(30,75,216,.28);
}
.topbar-inner {
  max-width: min(1880px, 100%); min-height: 76px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 44px; height: 44px; flex: none; border-radius: 11px;
  background: #ffffff; border: 1px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #2f6bf0;
}
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.brand-sub { font-size: 11px; color: #CFE0FF; margin-top: 2px; letter-spacing: .6px; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-width: 0; }
.badge {
  padding: 6px 12px; border-radius: 6px; font-size: 12px; overflow-wrap: anywhere;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.26); color: #E8F0FF;
}
.badge-date { font-weight: 600; color: #fff; }

/* ---------- 页面骨架与卡片 ---------- */
.page { max-width: min(1880px, 100%); min-width: 0; margin: 0 auto; padding: 26px 28px 48px; }
.card {
  background: var(--card); min-width: 0; max-width: 100%;
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; border: 1px solid var(--line);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 24px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid #EFF3FA;
}
.card-head h3 {
  flex: 0 1 auto; max-width: 100%; font-size: 16px; line-height: 1.65;
  font-weight: 700; color: var(--navy); overflow-wrap: anywhere;
}
.card-note { flex: 0 1 auto; min-width: 0; max-width: 100%; color: var(--ink-3); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.head-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-width: 0; max-width: 100%; }
/* 导出按钮（公网版在前端本地生成 xlsx，不经网络下载） */
.btn-export {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 14px; min-height: 38px;
  border: 1px solid #C4D8FB; border-radius: 7px;
  background: #EDF3FE; color: var(--blue);
  font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-export:hover { background: rgba(47,107,240,.14); border-color: rgba(47,107,240,.55); }

/* ---------- 提示文案 ---------- */
.empty-hint { padding: 26px 10px; text-align: center; color: var(--ink-3); font-size: 13px; }
.scroll-hint { font-size: 12px; line-height: 1.7; color: #6E80A6; }
.scroll-hint { margin: -4px 0 12px; }

/* ---------- 表格（清单主表） ---------- */
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.table-wrap { background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; color: #4C5F85; font-weight: 600; font-size: 12.5px;
  padding: 12px 10px; background: #EBF1FC;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 8.5px 10px; border-bottom: 1px solid #EFF3FA; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr:nth-child(even) { background: #FAFCFF; }
.tbl tbody tr:hover { background: rgba(47,107,240,.06); }
.tbl .num { text-align: right; }
.tbl th.num { text-align: right; }
.table-detail { max-height: 640px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; }
.table-detail .tbl th { position: sticky; top: 0; z-index: 3; }
.over1y-tbl { min-width: 1210px; }
table.over1y-tbl { border-collapse: separate; border-spacing: 0; }
.over1y-tbl tbody tr:not(.wh-detail) > td:first-child { position: sticky; left: 0; z-index: 1; background: inherit; box-shadow: 1px 0 0 #E4EAF6; font-weight: 600; color: var(--navy); }
.table-detail .over1y-tbl th:first-child { left: 0; z-index: 4; box-shadow: 1px 0 0 #C9D7F0; }
.over1y-tbl tr.wh-detail td[colspan] { position: static; }

/* 行内商品缩略图（点击放大，弹层交互同业绩看板单品矩阵） */
.over1y-tbl .thumb {
  display: inline-block; vertical-align: middle; width: 36px; height: 36px;
  border-radius: 8px; cursor: zoom-in; background: #fff; border: 1px solid #E4EAF6;
  position: relative; transition: box-shadow .15s, border-color .15s, transform .15s;
}
.over1y-tbl .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; border-radius: 8px; }
.over1y-tbl .thumb:hover { border-color: rgba(47,107,240,.55); box-shadow: 0 4px 12px rgba(47,107,240,.22); transform: translateY(-1px); }
.over1y-tbl .thumb.noimg { cursor: default; background: #F4F7FC; border-color: #EFF3FA; }
.over1y-tbl .thumb.noimg:hover { border-color: #EFF3FA; box-shadow: none; transform: none; }
.over1y-tbl .thumb.noimg::after {
  content: ""; position: absolute; inset: 18%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c7d2e0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='4'/><circle cx='9' cy='9' r='2'/><path d='M21 15.5l-4.2-4.2a2 2 0 0 0-2.8 0L5.5 19.8'/></svg>") center/contain no-repeat;
}
.over1y-tbl td.pic { width: 52px; }
.over1y-tbl .wh-txt { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* 清单筛选栏：关键词搜索 + 一级分类/三级分类/市场定位/仓库下拉 + 计数 */
.ov1y-filter { display: grid; grid-template-columns: minmax(240px, 1.8fr) repeat(4, minmax(130px, 1fr)); align-items: end; gap: 12px; padding: 16px; background: #F3F7FE; border: 1px solid #E1E9F8; border-radius: 10px; }
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ov1y-filter input[type="search"], .ov1y-filter select { width: 100%; max-width: 100%; min-width: 0; height: 40px; padding: 8px 10px; font-size: 13px; color: var(--ink); border: 1px solid #CBD9F1; border-radius: 6px; background: #fff; }
.ov1y-filter select { cursor: pointer; }
.ov1y-filter input[type="search"]:focus, .ov1y-filter select:focus { border-color: #5B8DEF; box-shadow: 0 0 0 3px rgba(47,107,240,.14); }
.filter-actions { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.btn-reset { min-height: 38px; padding: 7px 15px; border: 1px solid #CBD9F1; border-radius: 6px; background: #fff; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-reset:hover { background: #EAF1FE; border-color: #A9C6F8; color: var(--blue); }
.o1-count { font-size: 13px; font-weight: 600; color: var(--blue); margin-left: auto; }
.filter-note { margin: 10px 0 14px; font-size: 12px; line-height: 1.8; color: var(--ink-3); overflow-wrap: anywhere; }

/* 仓库明细展开按钮 + 明细行（点击懒渲染：前 6 列空出、仓库名占第 7 列，三个数字列与大表同名列逐列平齐） */
.over1y-tbl .wh-x {
  margin-left: 8px; padding: 1.5px 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(47,107,240,.3); background: rgba(47,107,240,.05);
  color: var(--blue); font-size: 11px; white-space: nowrap; vertical-align: middle;
  transition: background .15s;
}
.over1y-tbl .wh-x:hover { background: rgba(47,107,240,.15); }
.over1y-tbl tbody tr:nth-child(n) { background: #fff; }   /* 覆盖全局斑马纹：明细行会打乱 nth-child 配对 */
.over1y-tbl tbody tr.alt { background: #F7FAFE; }
.over1y-tbl tbody tr:hover { background: #EDF3FE; }
.over1y-tbl tr.wh-detail td { background: #F2F6FC; padding: 6px 10px; font-size: 12.5px; color: #3E527A; }
.over1y-tbl tr.wh-det-h td { font-weight: 700; color: #4C5F85; padding-top: 9px; border-bottom: 1px solid var(--line); }
.over1y-tbl tr.wh-detail td.wh-det-namecell { white-space: normal; overflow-wrap: anywhere; }   /* 超长仓库名换行而不撑宽整列 */
/* 表底合计行：吸底常驻（数量/体积/金额取整显示，与导出 xlsx 同口径；悬停单元格可见精确值） */
.table-detail .over1y-tbl tfoot td {
  position: sticky; bottom: 0; z-index: 3;
  background: #EAF1FE; font-weight: 700; color: var(--navy);
  border-top: 1px solid #C9D7F0; border-bottom: none;
}

/* ---------- 商品图预览弹层（点击缩略图；ESC / 点遮罩关闭） ---------- */
.img-modal { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.img-modal[hidden] { display: none; }
.img-modal-mask { position: absolute; inset: 0; background: rgba(16,29,58,.62); backdrop-filter: blur(3px); }
.img-modal-card {
  position: relative; margin: 0; z-index: 1; display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(7,15,40,.45);
  animation: img-modal-in .18s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes img-modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.img-modal-pic { display: flex; align-items: center; justify-content: center; background: #F5F8FD; padding: 10px; }
.img-modal-pic img { max-width: min(86vw, 760px); max-height: 58vh; object-fit: contain; display: block; }
.img-modal-x {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: rgba(16,29,58,.55); color: #fff;
  font-size: 19px; line-height: 1; cursor: pointer; transition: background .15s;
}
.img-modal-x:hover { background: rgba(16,29,58,.82); }
.img-modal-info { padding: 12px 18px 14px; border-top: 1px solid #EFF3FA; }
.imi-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.imi-title b { font-size: 16px; color: #1B2649; }
.imi-title span { font-size: 12.5px; color: #4C5F85; }
.imi-meta { font-size: 11.5px; color: #8B9CC0; margin-top: 3px; }
.imi-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: #6E80A6; }
.imi-stats b { color: var(--blue); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- 遮罩（加载 / 锁屏） ---------- */
.loading-mask, .lock-mask {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.82); backdrop-filter: blur(6px);
}
.loading-box { text-align: center; color: var(--ink-2); }
.spinner {
  width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 50%;
  border: 4px solid rgba(16,29,58,.1); border-top-color: var(--blue); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary {
  cursor: pointer; border: none; border-radius: 8px; padding: 7px 18px;
  background: var(--blue); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(47,107,240,.25); transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.lock-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(16,29,58,.12);
  padding: 38px 44px; text-align: center; width: 380px;
}
.lock-logo { font-size: 40px; }
.lock-card h2 { margin: 10px 0 6px; font-size: 20px; color: #1B2649; }
.lock-card p { color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.lock-card input {
  width: 100%; border: 1px solid #D9E2F2; border-radius: 10px; padding: 10px 14px;
  font-size: 14px; margin-bottom: 12px; outline-color: var(--blue);
  background: #fff; color: var(--ink);
}
.lock-card .btn-primary { width: 100%; padding: 10px; font-size: 14px; }
.lock-err { color: var(--up); font-size: 12.5px; margin-top: 10px; min-height: 18px; }

/* ================= 响应式（必须置于文件末尾以覆盖上方基础规则） ================= */
/* ---------- 大屏自适应（2K/4K 显示屏：容器加宽、字号放大） ---------- */
@media (min-width: 1920px) {
  body { font-size: 15px; }
  .card { padding: 22px 24px; }
  .tbl, table.tbl { font-size: 14px; }
}
@media (min-width: 2560px) {
  body { font-size: 16px; }
  .page, .topbar-inner { max-width: 2400px; }
}
/* ---------- 平板 ---------- */
@media (max-width: 1280px) {
  .ov1y-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
}
/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .topbar { position: static; }
  .topbar-inner { padding: 12px 14px; flex-wrap: wrap; gap: 12px; }
  .brand-logo { width: 38px; height: 38px; font-size: 19px; }
  .brand h1 { font-size: 18px; }
  .topbar-right { width: 100%; justify-content: flex-start; }
  .badge { padding: 5px 8px; font-size: 11px; }
  .page { padding: 16px 12px 32px; }
  .card { padding: 16px 12px; border-radius: 11px; }
  .card-head { gap: 7px; margin-bottom: 14px; padding-bottom: 11px; }
  .card-head h3 { flex-basis: 100%; font-size: 15px; }
  .head-right { width: 100%; }
  .img-modal-card { max-width: 100%; }
  .img-modal-pic img { max-width: 100%; max-height: 46vh; }
  .img-modal-info { padding: 10px 14px 12px; overflow-wrap: anywhere; }
  .imi-stats { gap: 12px; }
  .ov1y-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .ov1y-filter input[type="search"], .ov1y-filter select { font-size: 16px; min-height: 42px; }
  .tbl, table.tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 7px 7px; }
  .over1y-tbl tr.wh-detail td { padding: 6px 7px; }   /* 窄屏明细行内边距随表头 7px 同步，保持逐列对齐 */
  .table-detail { max-height: 520px; }
  .lock-card { width: calc(100vw - 48px); padding: 28px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
