/* ===================================================================
   各系统需更换备件统计表 —— 仿 WPS 在线表格
   =================================================================== */
:root{
  --acc:#12b36b;          /* WPS 表格 主色（绿） */
  --acc-d:#0e9a5b;
  --acc-l:#e8f8f0;
  --blue:#2b7fd4;
  --bd:#dcdfe4;
  --bd2:#c9ced6;
  --tx:#2b2f36;
  --tx2:#646b76;
  --tx3:#9aa1ab;
  --bg:#ffffff;
  --bg2:#f6f7f9;
  --bg3:#eef0f3;
  --hd:#f2f4f7;
  --sel:#12b36b;
  --shadow:0 4px 16px rgba(0,0,0,.14);
  --rb:28px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0;font:13px/1.5 "Microsoft YaHei","PingFang SC","Helvetica Neue",Arial,sans-serif;
  color:var(--tx);background:var(--bg2);overflow:hidden;
  display:flex;flex-direction:column;
  -webkit-user-select:none;user-select:none;
}
button{font-family:inherit}

/* ---------- 顶部：应用名 ---------- */
.apphead{
  height:44px;display:flex;align-items:center;gap:10px;padding:0 14px;flex:0 0 auto;
  background:linear-gradient(180deg,#ffffff,#f7f8fa);border-bottom:1px solid var(--bd);
  flex:0 0 auto;
}
.apphead .logo{
  width:22px;height:22px;border-radius:5px;background:var(--acc);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex:0 0 auto;
}
.apphead h1{
  font-size:15px;font-weight:700;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.apphead h1 small{font-weight:400;color:var(--tx2);font-size:12.5px;margin-left:8px}
.apphead .grow{flex:1}
.apphead .who{color:var(--tx2);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:230px}

/* ---------- 工具条 ---------- */
.ribbon{background:#fff;border-bottom:1px solid var(--bd);flex:0 0 auto;padding:4px 8px}
.rrow{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:2px 0;min-height:32px}
.rrow+.rrow{border-top:1px dashed #eef0f3}
.sep{width:1px;height:20px;background:var(--bd);margin:0 5px;flex:0 0 auto}
.tb{
  height:26px;min-width:26px;padding:0 6px;border:1px solid transparent;background:transparent;
  border-radius:4px;color:var(--tx);cursor:pointer;display:inline-flex;align-items:center;
  justify-content:center;gap:4px;font-size:12.5px;line-height:1;white-space:nowrap;
}
.tb:hover{background:var(--bg3)}
.tb:active{background:#e2e6ea}
.tb.on{background:var(--acc-l);border-color:#a9e2c6;color:var(--acc-d)}
.tb[disabled]{opacity:.35;cursor:default;background:transparent}
.tb svg{width:16px;height:16px;flex:0 0 auto;display:block}
.tb .cbd{width:0;height:0;border-left:3.4px solid transparent;border-right:3.4px solid transparent;border-top:4px solid #7b8290;margin-left:1px}
.tb.wide{padding:0 8px}
.tb .lbl{font-size:12.5px}

select.sel{
  height:26px;border:1px solid var(--bd);border-radius:4px;background:#fff;color:var(--tx);
  font-size:12.5px;padding:0 2px;max-width:132px;
}
select.sel:focus{outline:none;border-color:var(--acc)}
input.sz{width:46px;height:26px;border:1px solid var(--bd);border-radius:4px;text-align:center;font-size:12.5px;color:var(--tx)}
input.sz:focus{outline:none;border-color:var(--acc)}
.clrbtn{position:relative;flex-direction:column;gap:0;padding:2px 5px 1px}
.clrbtn .bar{width:16px;height:3px;border-radius:1px;background:#e23b3b;margin-top:1px}
.clrbtn .A{font-size:13px;font-weight:700;line-height:1}
.fmt-preview{font-size:13px;font-weight:700;line-height:1}

/* ---------- 公式栏 ---------- */
.fbar{display:flex;align-items:center;gap:6px;padding:4px 8px;background:#fff;border-bottom:1px solid var(--bd);flex:0 0 auto}
.fbar .addr{
  width:92px;height:26px;border:1px solid var(--bd);border-radius:4px;background:#fff;
  font-size:12.5px;padding:0 6px;color:var(--tx);text-align:center;
}
.fbar .addr:focus{outline:none;border-color:var(--acc)}
.fbar .fx{color:var(--tx3);font-style:italic;font-size:13px;padding:0 2px}
.fbar input.fml{
  flex:1;height:26px;border:1px solid var(--bd);border-radius:4px;padding:0 8px;font-size:12.5px;color:var(--tx);
}
.fbar input.fml:focus{outline:none;border-color:var(--acc)}

/* ---------- 表格区 ---------- */
.gridwrap{
  flex:1 1 auto;overflow:auto;background:#fff;position:relative;
  overscroll-behavior:contain;
}
table.grid{border-collapse:separate;border-spacing:0;table-layout:fixed;outline:none}
table.grid th,table.grid td{
  border-right:1px solid #e3e6ea;border-bottom:1px solid #e3e6ea;
  padding:0;margin:0;font-weight:400;vertical-align:middle;position:relative;
  height:30px;overflow:hidden;
}
/* 列头 */
th.ch{
  background:var(--hd);color:var(--tx2);font-size:12px;text-align:center;font-weight:400;
  position:sticky;top:0;z-index:5;cursor:pointer;border-bottom:1px solid var(--bd2);
}
th.ch .chb{display:block;padding:0 12px 0 4px;line-height:29px;white-space:nowrap;overflow:hidden}
th.ch .fbtn{
  position:absolute;right:1px;top:50%;transform:translateY(-50%);width:14px;height:16px;
  display:none;align-items:center;justify-content:center;border-radius:2px;background:transparent;border:0;cursor:pointer;
}
th.ch:hover .fbtn{display:flex}
th.ch .fbtn svg{width:10px;height:10px}
th.ch .fbtn.fon{display:flex;background:var(--acc);border-radius:3px}
th.ch .fbtn.fon svg path{fill:#fff}
th.ch.act{background:#e6f6ee;color:var(--acc-d)}
th.ch .rsz{position:absolute;right:-3px;top:0;width:7px;height:100%;cursor:col-resize;z-index:6}
/* 行头 */
th.rh{
  background:var(--hd);color:var(--tx2);font-size:12px;text-align:center;font-weight:400;
  position:sticky;left:0;z-index:4;cursor:pointer;border-right:1px solid var(--bd2);width:44px;
}
th.rh.act{background:#e6f6ee;color:var(--acc-d)}
th.corner{position:sticky;left:0;top:0;z-index:7;background:var(--hd);border-right:1px solid var(--bd2);border-bottom:1px solid var(--bd2);cursor:pointer}
td.cell{background:#fff;cursor:cell}
td.cell .cv{
  padding:1px 5px;width:100%;height:100%;display:flex;overflow:hidden;white-space:pre-wrap;
  word-break:break-word;line-height:1.35;align-items:center;
}
td.cell.nw .cv{white-space:nowrap;word-break:normal}
td.cell.center .cv{justify-content:center;text-align:center}
td.cell.right .cv{justify-content:flex-end;text-align:right}
td.cell.top .cv{align-items:flex-start}
td.cell.mid .cv{align-items:center}
td.cell.bot .cv{align-items:flex-end}
td.cell img.cimg{
  max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;display:block;margin:auto;cursor:zoom-in;
}
td.cell.imgshell .cv{padding:1px;align-items:center;justify-content:center}
td.cell .imgcol{display:flex;flex-direction:column;gap:1px;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden}
td.cell .imgcol img.cimg{max-height:calc(50% - 1px)}
td.cell .imgcol img.cimg:only-child{max-height:100%}
td.cell .num{font-variant-numeric:tabular-nums}
/* 选择 / 活动 */
td.cell.sel{background:#e9f7f0}
td.cell.sel::after{content:"";position:absolute;inset:0;background:rgba(18,179,107,.07);pointer-events:none}
td.cell.act{outline:2px solid var(--sel);outline-offset:-2px;z-index:2}
td.cell.hl{box-shadow:inset 0 0 0 1px rgba(18,179,107,.5)}
td.cell .cfill{position:absolute;inset:0}
/* 合并 */
td.cell.merged-hidden{display:none}
/* 编辑态 */
#ed{
  position:absolute;z-index:40;display:none;border:2px solid var(--acc);background:#fff;
  padding:1px 4px;font:13px/1.35 "Microsoft YaHei",Arial,sans-serif;color:var(--tx);
  outline:none;resize:none;overflow:hidden;white-space:pre-wrap;word-break:break-word;
  box-shadow:0 2px 8px rgba(0,0,0,.12);border-radius:1px;
}
/* 隐藏行（筛选） */
table.grid tr.hid,table.grid td.hidcol,table.grid th.hidcol{display:none}

/* ---------- 冻结提示线 ---------- */
.fzline{position:absolute;background:var(--acc);z-index:8;pointer-events:none;display:none}

/* ---------- 底部 Sheet 栏 ---------- */
.sheetbar{
  flex:0 0 auto;display:flex;align-items:center;gap:0;background:var(--bg2);
  border-top:1px solid var(--bd);height:34px;padding:0 6px;overflow-x:auto;
}
.stab{
  height:34px;padding:0 14px;display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--tx2);
  border:1px solid transparent;border-bottom:0;cursor:pointer;white-space:nowrap;position:relative;top:1px;
  background:transparent;border-radius:6px 6px 0 0;
}
.stab:hover{background:#eceef1}
.stab.act{background:#fff;color:var(--acc-d);font-weight:700;border-color:var(--bd);border-bottom:1px solid #fff}
.stab.act::after{content:"";position:absolute;left:10px;right:10px;top:-1px;height:2px;background:var(--acc);border-radius:2px}
.stab .x{opacity:0;font-size:11px;color:var(--tx3)}
.stab:hover .x{opacity:1}
.stab input{border:1px solid var(--acc);border-radius:3px;font:12.5px inherit;padding:1px 4px;width:120px}
.sheetbar .add{width:26px;height:24px;border:0;background:transparent;color:var(--tx2);font-size:17px;cursor:pointer;border-radius:4px}
.sheetbar .add:hover{background:#e6e9ed}

/* ---------- 状态栏 ---------- */
.statusbar{
  flex:0 0 auto;height:26px;display:flex;align-items:center;gap:14px;padding:0 12px;
  background:#fff;border-top:1px solid var(--bd);font-size:12px;color:var(--tx2);overflow:hidden;white-space:nowrap;
}
.statusbar .grow{flex:1}
.statusbar b{color:var(--tx);font-weight:600}
.statusbar .zoom{display:flex;align-items:center;gap:4px}
.statusbar .zoom input[type=range]{width:90px}
.statusbar .dot{width:7px;height:7px;border-radius:50%;background:#c3c9d2;display:inline-block}
.statusbar .dot.ok{background:var(--acc)}
.statusbar .dot.warn{background:#e8a33d}
.statusbar .dot.err{background:#e23b3b}

/* ---------- 弹层 ---------- */
.pop{
  position:fixed;z-index:200;background:#fff;border:1px solid var(--bd);border-radius:8px;
  box-shadow:var(--shadow);padding:5px;display:none;min-width:150px;
}
.pop.open{display:block}
.pop .pi{
  height:30px;padding:0 10px;display:flex;align-items:center;gap:8px;border-radius:5px;cursor:pointer;
  font-size:12.5px;color:var(--tx);white-space:nowrap;
}
.pop .pi:hover{background:var(--bg3)}
.pop .pi.on{background:var(--acc-l);color:var(--acc-d)}
.pop .pi svg{width:15px;height:15px;flex:0 0 auto}
.pop .pi .k{margin-left:auto;color:var(--tx3);font-size:11.5px}
.pop hr{border:0;border-top:1px solid var(--bd);margin:4px 2px}
.pop .psep{height:1px;background:var(--bd);margin:4px 2px}
.pop .ph{padding:5px 10px 3px;font-size:11.5px;color:var(--tx3)}
/* 颜色板 */
.pal{display:grid;grid-template-columns:repeat(10,20px);gap:3px;padding:5px}
.pal b{width:20px;height:20px;border-radius:3px;border:1px solid rgba(0,0,0,.12);cursor:pointer;display:block}
.pal b:hover{outline:2px solid var(--acc)}
.pal b.none{background:#fff;position:relative}
.pal b.none::after{content:"";position:absolute;left:2px;right:2px;top:50%;height:1.5px;background:#e23b3b;transform:rotate(-45deg)}
/* 颜色格（字体色 / 填充色）*/
.cbgrid{display:grid;grid-template-columns:repeat(10,20px);gap:3px;padding:5px}
.cbgrid b{width:20px;height:20px;border-radius:3px;border:1px solid rgba(0,0,0,.12);cursor:pointer}
.cbgrid b:hover{outline:2px solid var(--acc)}
/* 粗边框/细边框二级菜单 */
.bdpop{display:flex;flex-direction:column;gap:5px}
.bdpop .row{display:flex;gap:5px}
.bdpop button{width:52px;height:38px;border:1px solid var(--bd);border-radius:5px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.bdpop button:hover{background:var(--acc-l);border-color:#a9e2c6}
.bdpop button svg{width:34px;height:26px}
.bdpop .g2{display:grid;grid-template-columns:26px 26px 26px;gap:6px;padding:0 2px}

/* ---------- 模态框 ---------- */
.mask{position:fixed;inset:0;background:rgba(20,24,30,.34);z-index:300;display:none;align-items:center;justify-content:center;padding:18px}
.mask.open{display:flex}
.dlg{
  background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.24);width:100%;max-width:460px;
  max-height:88vh;display:flex;flex-direction:column;overflow:hidden;
}
.dlg.wide{max-width:720px}
.dlg h3{margin:0;padding:14px 18px;font-size:14.5px;border-bottom:1px solid var(--bd);display:flex;align-items:center}
.dlg h3 .x{margin-left:auto;cursor:pointer;color:var(--tx3);font-size:17px;line-height:1;background:none;border:0}
.dlg .body{padding:14px 18px;overflow:auto}
.dlg .foot{padding:12px 18px;border-top:1px solid var(--bd);display:flex;gap:10px;justify-content:flex-end}
.btn{height:32px;padding:0 16px;border-radius:7px;border:1px solid var(--bd);background:#fff;cursor:pointer;font-size:13px;color:var(--tx)}
.btn:hover{background:var(--bg3)}
.btn.pri{background:var(--acc);border-color:var(--acc);color:#fff;font-weight:600}
.btn.pri:hover{background:var(--acc-d)}
.btn.gh{background:#fff;color:var(--acc-d);border-color:#b9e3ce}
.dlg label.f{display:block;margin:10px 0 5px;font-size:12.5px;color:var(--tx2)}
.dlg input[type=text],.dlg input[type=email],.dlg input[type=password],.dlg select,.dlg textarea{
  width:100%;height:34px;border:1px solid var(--bd);border-radius:7px;padding:0 10px;font:13px inherit;color:var(--tx);
}
.dlg textarea{height:auto;padding:8px 10px;line-height:1.5}
.dlg input:focus,.dlg select:focus,.dlg textarea:focus{outline:none;border-color:var(--acc)}
.dlg .tip{font-size:12px;color:var(--tx2);line-height:1.6;margin-top:8px}
.dlg .err{color:#e23b3b;font-size:12.5px;min-height:18px;margin-top:8px}

/* ---------- 查找替换条 ---------- */
.findbar{
  position:absolute;right:16px;top:8px;z-index:120;background:#fff;border:1px solid var(--bd);
  border-radius:9px;box-shadow:var(--shadow);padding:7px 9px;display:none;gap:6px;align-items:center;
}
.findbar.open{display:flex}
.findbar input{height:28px;border:1px solid var(--bd);border-radius:6px;padding:0 8px;font-size:12.5px;width:130px}
.findbar input:focus{outline:none;border-color:var(--acc)}
.findbar .n{font-size:12px;color:var(--tx2);min-width:52px;text-align:center}

/* ---------- 图片查看 ---------- */
#lbox{
  position:fixed;inset:0;background:rgba(10,12,16,.9);z-index:400;display:none;align-items:center;
  justify-content:center;flex-direction:column;gap:12px;padding:26px;
}
#lbox.open{display:flex}
#lbox img{max-width:96vw;max-height:82vh;object-fit:contain;background:#fff;border-radius:6px;cursor:zoom-in;transition:transform .12s}
#lbox img.z2{transform:scale(2);cursor:zoom-out}
#lbox .lb{color:#e9edf2;font-size:13px;display:flex;gap:14px;align-items:center}
#lbox .lb button{background:rgba(255,255,255,.14);border:0;color:#fff;height:30px;padding:0 14px;border-radius:6px;cursor:pointer;font-size:13px}
#lbox .lb button:hover{background:rgba(255,255,255,.26)}
#lbox .cnt{color:#cfd8e3;font-size:13px;min-width:56px;text-align:center}
#lbox .lbnav{position:absolute;top:50%;transform:translateY(-50%);width:46px;height:78px;border:0;border-radius:9px;background:rgba(255,255,255,.16);color:#fff;font-size:30px;line-height:1;cursor:pointer;display:none}
#lbox .lbnav:hover{background:rgba(255,255,255,.32)}
#lbox .lbnav.on{display:block}
#lbox #lbPrev{left:14px} #lbox #lbNext{right:14px}

/* ---------- 提示 ---------- */
#toast{
  position:fixed;left:50%;bottom:52px;transform:translateX(-50%);z-index:500;display:flex;
  flex-direction:column;gap:8px;align-items:center;pointer-events:none;
}
#toast .t{
  background:rgba(30,34,40,.93);color:#fff;font-size:12.5px;padding:8px 15px;border-radius:20px;
  box-shadow:0 6px 20px rgba(0,0,0,.24);max-width:80vw;text-align:center;animation:tin .18s ease;
}
#toast .t.ok{background:rgba(14,154,91,.95)}
#toast .t.err{background:rgba(212,58,58,.95)}
@keyframes tin{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* 筛选菜单里的取值列表 */
.fchk{max-height:216px;overflow:auto;margin:3px 2px}
.fchk label{display:flex;align-items:center;gap:7px;padding:3px 8px;font-size:12.5px;border-radius:4px;cursor:pointer;white-space:nowrap;max-width:280px}
.fchk label:hover{background:var(--bg3)}
.fchk label span{overflow:hidden;text-overflow:ellipsis}

/* 条件格式规则行 */
.cfrow{display:flex;align-items:center;gap:8px;padding:7px 4px;border-bottom:1px solid #eef0f3;font-size:12.5px}
.cfrow .sw{width:20px;height:20px;border-radius:4px;border:1px solid rgba(0,0,0,.14);flex:0 0 auto}
.cfrow .tx{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cfrow .del{border:0;background:none;color:#e23b3b;cursor:pointer;font-size:14px}
.cfrow select,.cfrow input[type=text]{height:28px;border:1px solid var(--bd);border-radius:6px;padding:0 7px;font-size:12.5px}
.cfrow input[type=text]{flex:1;min-width:90px}

/* 导出菜单 / 移动端 */
@media (max-width:760px){
  .apphead{height:40px;padding:0 8px}
  .apphead h1{font-size:13.5px}
  .apphead h1 small{display:none}
  .apphead .who{max-width:110px;font-size:11px}
  .ribbon{padding:3px 5px}
  .tb{height:30px;min-width:30px}
  .tb svg{width:18px;height:18px}
  .tb .lbl{display:none}
  th.rh{width:38px}
  .statusbar .zoom{display:none}
}
