/* ============================================================
   工程项目管理台 —— 像素风皮肤（黑白极简 + 橙色亮色）
   规则：零圆角 · 硬边框 · 硬投影 · 等宽字 · 8px 网格底纹
   ============================================================ */

:root {
  --ink: #000;
  --ink2: #3d3d3d;
  --ink3: #6f6f6f;
  --ink4: #9b9b9b;

  --line: #000;
  --line2: #dcdcdc;
  --line3: #efefef;

  --bg: #ffffff;
  --bg2: #f6f6f6;
  --bg3: #ececec;

  --acc: #ff6a00;
  --acc2: #ffa24d;
  --acc3: #ffd6b0;
  --acc-bg: #fff6ee;

  --dan: #cc2222;
  --okc: #0b6b34;

  --sh: 3px 3px 0 var(--ink);
  --sh-sm: 2px 2px 0 var(--ink);

  --tx: var(--ink);
  --tx2: #4a4a4a;
  --tx3: #8a8a8a;
  --brand: var(--acc);
  --warn: var(--acc);
  --ok: var(--okc);

  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --pix: "Fusion Pixel 12px monospaced", "fusion-pixel", "Zpix", var(--mono);
}

/* 像素字体（由 JS 用 FontFace 动态加载；未加载成功自动退回等宽字） */
body.pix-on { font-family: var(--pix); font-size: 12px; line-height: 1.7; }
body.pix-on .modal-t, body.pix-on .nav-group { letter-spacing: 0; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body {
  background-image:
    linear-gradient(var(--line3) 1px, transparent 1px),
    linear-gradient(90deg, var(--line3) 1px, transparent 1px);
  background-size: 8px 8px;
  background-attachment: fixed;
}
img { image-rendering: pixelated; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.hidden { display: none !important; }
.tx3 { color: var(--tx3); }
.money, .num { text-align: right; font-variant-numeric: tabular-nums; }
.acc { color: var(--acc); }
.pos { color: var(--okc); }
.neg { color: var(--dan); font-weight: 700; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--bg2); }

/* ============ 加载页 / 登录页 ============ */
.boot {
  position: fixed; inset: 0; z-index: 99;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.boot-box { text-align: center; padding: 24px; }
.boot-logo {
  width: 62px; height: 62px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--acc);
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
  box-shadow: var(--sh);
  animation: pix-blink 1.1s steps(2, jump-none) infinite;
}
@keyframes pix-blink { 0%, 100% { background: var(--ink); color: var(--acc); } 50% { background: var(--acc); color: var(--ink); } }
.boot-title { font-size: 17px; font-weight: 700; letter-spacing: 2px; }
.boot-sub { color: var(--tx3); font-size: 12px; margin-top: 6px; }

.auth {
  position: fixed; inset: 0; z-index: 90; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 16px;
  background: var(--bg2);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg); border: 2px solid var(--line); box-shadow: 5px 5px 0 var(--ink);
  padding: 22px;
}
.auth-head { text-align: center; margin-bottom: 16px; }
.auth-logo {
  width: 54px; height: 54px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--acc); border: 2px solid var(--ink);
  font-size: 19px; font-weight: 700; box-shadow: var(--sh-sm);
}
.auth-head h1 { font-size: 18px; margin: 0 0 4px; letter-spacing: 1px; }
.auth-head p { margin: 0; color: var(--tx3); font-size: 11.5px; }

.auth-tabs { display: flex; gap: 0; margin-bottom: 14px; border: 2px solid var(--ink); }
.atab {
  flex: 1; padding: 8px 4px; background: var(--bg); border: none;
  font-size: 12.5px; cursor: pointer; letter-spacing: .5px;
}
.atab + .atab { border-left: 2px solid var(--ink); }
.atab.active { background: var(--ink); color: #fff; }
.apane { display: none; }
.apane.active { display: block; }

.fl { display: block; margin: 12px 0 5px; font-size: 12px; letter-spacing: .5px; }
.fi {
  width: 100%; padding: 9px 10px;
  background: var(--bg); border: 2px solid var(--ink); outline: none;
}
.fi:focus { border-color: var(--acc); box-shadow: var(--sh-sm); }
.fi-row { display: flex; gap: 8px; }
.fi-btn { flex: none; white-space: nowrap; }
.ferr { min-height: 15px; font-size: 11.5px; color: var(--dan); }
.auth-links { text-align: right; margin-top: 10px; font-size: 12px; }
.auth-links a { color: var(--acc); text-decoration: underline; }
.auth-split { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--tx3); font-size: 11px; }
.auth-split::before, .auth-split::after { content: ''; flex: 1; height: 2px; background: var(--line2); }
.auth-tip { margin: 12px 0 0; font-size: 11.5px; color: var(--tx3); text-align: center; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 14px;
  border: 2px solid var(--ink); background: var(--bg); color: var(--ink);
  cursor: pointer; font-size: 12.5px; letter-spacing: .5px;
  box-shadow: var(--sh-sm); transition: transform .06s steps(2), box-shadow .06s steps(2);
  user-select: none;
}
.btn:hover { background: var(--bg2); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--sh-sm); }
.btn-sm { padding: 5px 10px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
.btn-block { width: 100%; margin-top: 14px; padding: 11px; }
.btn-primary { background: var(--acc); color: var(--ink); font-weight: 700; }
.btn-primary:hover { background: #ff8124; }
.btn-ghost { background: var(--bg); }
.btn-danger { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-danger:hover { background: var(--dan); border-color: var(--dan); }
.btn-wx { background: var(--bg2); }
.btn-wx:hover { background: var(--bg3); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--bg); border: 2px solid var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--acc); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.on { background: var(--acc); }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg); border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 32px; height: 32px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--acc); font-weight: 700; font-size: 13px;
  border: 2px solid var(--ink); box-shadow: var(--sh-sm);
}
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.proj-pick { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.proj-sel {
  max-width: 220px; padding: 6px 8px;
  border: 2px solid var(--ink); background: var(--bg); outline: none; font-size: 12.5px;
}
.proj-sel:focus { border-color: var(--acc); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who { font-size: 12px; color: var(--tx2); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 布局 ============ */
.layout { display: flex; align-items: flex-start; min-height: calc(100vh - 50px); }
.sidebar {
  width: 196px; flex: none;
  background: var(--bg); border-right: 2px solid var(--ink);
  padding: 10px 0 40px;
  position: sticky; top: 50px; max-height: calc(100vh - 50px); overflow-y: auto;
}
.nav-group { padding: 10px 14px 4px; font-size: 10.5px; color: var(--tx3); letter-spacing: 1.5px; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; border-left: 4px solid transparent;
}
.nav-item:hover { background: var(--bg2); }
.nav-item.active { background: var(--acc-bg); border-left-color: var(--acc); font-weight: 700; }
.nav-item .ico { width: 18px; text-align: center; }

.main { flex: 1; min-width: 0; padding: 14px; }

.mask { position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .45); display: none; }
.mask.on { display: block; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; background: var(--ink); border-top: 2px solid var(--ink);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 2px; color: #fff; font-size: 10.5px;
}
.tabbar a .ico { font-size: 16px; line-height: 1; }
.tabbar a:active { background: var(--acc); color: var(--ink); }

/* ============ 页面头 / 卡片 / 网格 ============ */
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-title { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: 1px; }
.page-desc { margin: 3px 0 0; color: var(--tx3); font-size: 12px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.card { background: var(--bg); border: 2px solid var(--ink); }
.card.pad { padding: 14px; }
.grid { display: grid; gap: 12px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.charts { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); margin-top: 12px; }

.kpi { padding: 12px; background: var(--bg); border: 2px solid var(--ink); box-shadow: var(--sh); }
.kpi-l { font-size: 11.5px; color: var(--tx2); letter-spacing: .5px; }
.kpi-v { font-size: 20px; font-weight: 700; margin: 5px 0 3px; word-break: break-all; line-height: 1.25; }
.kpi-s { font-size: 11px; color: var(--tx3); }
.kpi.g .kpi-v { color: var(--ink); }
.kpi.o .kpi-v { color: var(--acc); }
.kpi.r .kpi-v { color: var(--dan); }
.kpi.b .kpi-v { color: var(--ink); }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill {
  padding: 5px 10px; background: var(--bg); border: 2px solid var(--ink);
  font-size: 11.5px; color: var(--tx2);
}
.pill b { color: var(--ink); }

.info-box {
  padding: 10px 12px; background: var(--bg2); border: 2px solid var(--ink);
  border-left-width: 6px; border-left-color: var(--acc);
  font-size: 12.5px; line-height: 1.75;
}
.warn-box {
  padding: 10px 12px; background: #fff; border: 2px solid var(--dan);
  border-left-width: 6px; color: var(--dan); font-size: 12.5px;
}

/* ============ 标签 ============ */
.tag {
  display: inline-block; padding: 1px 6px;
  border: 1px solid var(--ink); background: var(--bg); color: var(--ink);
  font-size: 11px; line-height: 1.5; white-space: nowrap;
}
.tag.g { background: var(--ink); color: #fff; }
.tag.r { background: var(--dan); border-color: var(--dan); color: #fff; }
.tag.b { background: var(--acc-bg); border-color: var(--acc); color: #a34100; }
.tag.o { background: var(--acc); border-color: var(--ink); color: var(--ink); }

/* ============ 表格 ============ */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px; background: var(--bg2); border: 2px solid var(--ink); margin-bottom: 0;
}
.tb-search { position: relative; display: flex; align-items: center; }
.tb-search svg { position: absolute; left: 8px; color: var(--tx3); }
.tb-search .fi { padding-left: 28px; min-width: 200px; }
.toolbar .f {
  padding: 7px 8px; border: 2px solid var(--ink); background: var(--bg); outline: none; font-size: 12.5px;
  max-width: 190px;
}
.toolbar .f:focus { border-color: var(--acc); }

.tbl-wrap { overflow: auto; border: 2px solid var(--ink); border-top: none; background: var(--bg); max-width: 100%; }
.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th, .tbl td { padding: 7px 9px; border-bottom: 1px solid var(--line3); white-space: nowrap; }
.tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--ink); color: #fff; font-weight: 700;
  letter-spacing: .5px; text-align: left; border-bottom: 2px solid var(--ink);
  font-size: 11.5px;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { background: var(--acc); color: var(--ink); }
.tbl tbody tr:nth-child(even) { background: #fafafa; }
.tbl tbody tr:hover { background: var(--acc-bg); }
.tbl tfoot td { background: var(--bg3); font-weight: 700; border-top: 2px solid var(--ink); }
.tbl-count { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 10px; background: var(--bg2); border: 2px solid var(--ink); border-top: none; font-size: 11.5px; color: var(--tx2); }

.row-act { text-align: right; }
.row-act a { color: var(--tx2); margin-left: 8px; font-size: 12px; }
.row-act a:hover { color: var(--acc); text-decoration: underline; }
.row-act a.del:hover { color: var(--dan); }
.row-act .att-btn b { color: var(--acc); }
.row-act .att-btn { text-decoration: none !important; }

.empty { padding: 40px 16px; text-align: center; color: var(--tx3); font-size: 13px; }
.empty-big { font-size: 34px; margin-bottom: 8px; }

.bar { position: relative; height: 16px; background: var(--bg3); border: 1px solid var(--ink); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); }
.bar.mid i { background: var(--acc2); }
.bar.full i { background: var(--ink); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 10.5px; line-height: 16px; }

/* ============ 图表 ============ */
.chart-card { display: flex; flex-direction: column; }
.chart-h { padding: 10px 12px; border-bottom: 2px solid var(--ink); background: var(--bg2); }
.chart-t { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.chart-x { font-size: 11px; color: var(--tx3); }
.chart-wrap { padding: 12px; height: 260px; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; overflow: auto; background: rgba(0, 0, 0, .5);
}
.modal-box {
  width: 100%; max-width: 760px; background: var(--bg);
  border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
}
.modal-h { padding: 12px 16px; border-bottom: 2px solid var(--ink); background: var(--ink); }
.modal-t { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.modal-c { padding: 16px; max-height: calc(100vh - 220px); overflow: auto; }
.modal-f {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 16px; border-top: 2px solid var(--ink); background: var(--bg2);
}

.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ff.full { grid-column: 1/-1; }
.ff label { display: block; margin-bottom: 5px; font-size: 12px; letter-spacing: .5px; color: var(--tx2); }
.ff input, .ff select, .ff textarea {
  width: 100%; padding: 8px 9px;
  border: 2px solid var(--ink); background: var(--bg); outline: none;
}
.ff input:focus, .ff select:focus, .ff textarea:focus { border-color: var(--acc); box-shadow: var(--sh-sm); }
.ff textarea { min-height: 66px; resize: vertical; }
.hint { margin-top: 6px; font-size: 11.5px; color: var(--tx3); line-height: 1.6; }

.cols-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cols-box label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.cols-box input { width: 16px; height: 16px; accent-color: var(--acc); }

.ckbx { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 12.5px; cursor: pointer; }
.ckbx input { width: 16px; height: 16px; accent-color: var(--acc); }

/* ============ 权限矩阵 ============ */
.perm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.perm-grid { border: 2px solid var(--ink); background: var(--bg); }
.perm-row { display: grid; grid-template-columns: 1fr 62px 62px 62px; align-items: center; }
.perm-row > span { padding: 7px 9px; font-size: 12.5px; border-bottom: 1px solid var(--line3); }
.perm-row > span:not(:first-child) { text-align: center; }
.perm-head { background: var(--ink); color: #fff; font-size: 11.5px; letter-spacing: 1px; }
.perm-head > span { border-bottom: none; padding: 6px 4px; }
.perm-row:nth-child(even of .perm-row) { background: #fafafa; }
.perm-row input { width: 16px; height: 16px; accent-color: var(--acc); }

/* ============ 附件 ============ */
.att-sub { margin-bottom: 10px; font-size: 12.5px; color: var(--tx2); }
.att-drop {
  padding: 18px 14px; text-align: center; cursor: pointer;
  border: 2px dashed var(--ink); background: var(--acc-bg);
}
.att-drop:hover { background: #ffead6; }
.att-drop-ic { font-size: 24px; }
.att-drop-t { font-weight: 700; font-size: 13px; margin-top: 4px; }
.att-drop-s { font-size: 11.5px; color: var(--tx3); margin-top: 3px; }
.att-act-row { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.att-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-bottom: 12px; }
.att-meta .f { padding: 7px 9px; border: 2px solid var(--ink); background: var(--bg); outline: none; font-size: 12.5px; }
.att-meta .f:focus { border-color: var(--acc); }
.att-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 2px solid var(--ink); margin-bottom: 10px; font-size: 12.5px;
}
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-item { display: flex; gap: 10px; padding: 8px; border: 2px solid var(--ink); background: var(--bg); align-items: flex-start; }
.att-thumb {
  width: 62px; height: 62px; flex: none; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); background: var(--bg3); font-size: 22px;
}
.att-thumb.big { width: 100%; height: 130px; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb:hover { border-color: var(--acc); }
.att-info { flex: 1; min-width: 0; }
.att-t { font-weight: 700; font-size: 13px; word-break: break-all; }
.att-m { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--tx2); }
.att-m2 { font-size: 11.5px; color: var(--tx3); margin-top: 2px; word-break: break-all; }
.att-amt { color: var(--acc); font-weight: 700; }
.att-ops { display: flex; flex-direction: column; gap: 5px; flex: none; }
.att-ops .btn { padding: 3px 8px; font-size: 11.5px; }

.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.att-card { border: 2px solid var(--ink); background: var(--bg); box-shadow: var(--sh-sm); display: flex; flex-direction: column; }
.att-card-b { padding: 8px 9px 9px; flex: 1; display: flex; flex-direction: column; }
.att-hook { font-size: 11.5px; color: var(--acc); margin-top: 3px; word-break: break-all; }
.att-card .att-ops { flex-direction: row; flex-wrap: wrap; margin-top: 6px; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: #fff; font-size: 12.5px; border-bottom: 2px solid var(--acc); }
.lb-bar #lb-x { margin-left: auto; background: var(--acc); border: 2px solid var(--ink); padding: 4px 10px; cursor: pointer; }
.lb-bar #lb-open { color: var(--acc); font-size: 12px; }
.lb-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 12px; }
.lb-body img { max-width: 100%; max-height: 100%; border: 2px solid var(--acc); }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%) translateY(20px);
  z-index: 95; padding: 10px 18px;
  background: var(--ink); color: #fff; border: 2px solid var(--ink); box-shadow: var(--sh);
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .12s steps(3);
  max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--acc); color: var(--ink); }
.toast.err { background: var(--dan); border-color: var(--dan); }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .grid.charts { grid-template-columns: 1fr; }
  .who { display: none; }
}
@media (max-width: 780px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: 240px; transform: translateX(-105%); transition: transform .12s steps(3);
    max-height: none;
  }
  .sidebar.on { transform: translateX(0); }
  .layout { display: block; }
  .main { padding: 10px 10px 76px; }
  .tabbar { display: flex; }
  .only-mobile { display: inline-flex; }
  .top-right .icon-btn:not(#btn-logout):not(#btn-install) { display: none; }
  .brand-name { display: none; }
  .proj-sel { max-width: 140px; font-size: 12px; }
  .modal { padding: 10px; align-items: flex-start; }
  .modal-box { max-width: 100%; box-shadow: none; }
  .modal-c { max-height: calc(100vh - 190px); }
  .chart-wrap { height: 220px; }
  .kpi { box-shadow: none; }
  .tbl-wrap { border-left: none; border-right: none; }
  .att-ops { flex-direction: row; flex-wrap: wrap; }
  .toolbar .f { max-width: none; flex: 1; }
  .tb-search { flex: 1 1 100%; }
  .tb-search .fi { min-width: 0; width: 100%; }
}
@media (min-width: 781px) { .only-mobile { display: none !important; } }

/* ============================================================
   安装到桌面 / 分享给同事
   ============================================================ */
#btn-install.ready { background: var(--acc); animation: iblink 1.1s steps(2) infinite; }
@keyframes iblink { 0%,100% { background: var(--acc); } 50% { background: var(--acc2); } }

.install-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 58;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 2px solid var(--ink); box-shadow: var(--sh);
  padding: 10px 12px; max-width: min(760px, calc(100vw - 20px));
}
.install-bar .ib-ico { font-size: 20px; }
.install-bar .ib-tx { font-size: 12px; flex: 1; min-width: 120px; }

.modal-box.wide { max-width: 880px; }

.sh-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.sh-qr {
  flex: 0 0 186px; background: #fff; border: 2px solid var(--ink);
  box-shadow: var(--sh-sm); padding: 8px; text-align: center;
}
.sh-qr img { width: 100%; display: block; image-rendering: pixelated; }
.sh-qr-cap { font-size: 11px; color: var(--ink3); margin-top: 6px; }
.sh-qr-x { padding: 30px 8px; font-size: 11px; color: var(--ink3); }

.sh-main { flex: 1 1 300px; min-width: 220px; }
.sh-url {
  display: flex; gap: 8px; align-items: center;
  border: 2px solid var(--ink); background: var(--bg2); padding: 6px 8px;
}
.sh-url code { flex: 1; font-size: 12px; word-break: break-all; }
.sh-note { font-size: 12px; color: var(--ink2); line-height: 1.85; margin-top: 8px; }
.sh-ok {
  margin-top: 10px; padding: 8px 10px; border: 2px solid var(--okc);
  color: var(--okc); font-weight: 700; font-size: 12px;
}
.sh-tip {
  margin-top: 10px; padding: 8px 10px; font-size: 12px;
  background: var(--acc-bg); border-left: 4px solid var(--acc); line-height: 1.8;
}

.sh-guide { margin-top: 16px; }
.sh-guide details { border: 2px solid var(--ink); margin-bottom: 8px; }
.sh-guide summary {
  padding: 8px 10px; cursor: pointer; font-weight: 700; font-size: 12px;
  background: var(--bg2); list-style: none;
}
.sh-guide summary::-webkit-details-marker { display: none; }
.sh-guide summary::before { content: '▸ '; color: var(--acc); }
.sh-guide details[open] summary { background: var(--acc); }
.sh-guide details[open] summary::before { content: '▾ '; color: var(--ink); }
.sh-guide ol { margin: 8px 0 10px; padding-left: 28px; font-size: 12px; line-height: 1.95; }
.sh-guide ol li { margin-bottom: 3px; }

.sh-warn {
  margin-top: 14px; padding-top: 10px; border-top: 2px dashed var(--line2);
  font-size: 12px; color: var(--ink2); line-height: 1.85;
}

@media (max-width: 780px) {
  .install-bar { bottom: 74px; flex-wrap: wrap; }
  .install-bar .ib-tx { flex: 1 1 100%; order: -1; }
  .sh-qr { flex: 0 0 auto; width: 168px; margin: 0 auto; }
  .sh-wrap { flex-direction: column; }
}

/* ============================================================
   台账发票影像批量挂接
   ============================================================ */
.ii-step { display: flex; gap: 12px; padding: 12px 0; border-top: 2px solid var(--line3); }
.ii-step:first-of-type { border-top: none; }
.ii-step-n {
  flex: 0 0 26px; width: 26px; height: 26px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.ii-step-b { flex: 1; min-width: 0; }
.ii-step-t { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.ii-step-d { font-size: 12px; color: var(--ink2); line-height: 1.85; }
.ii-step-d code { background: var(--bg2); border: 1px solid var(--line2); padding: 1px 5px; }
.ii-step-a { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ii-picked { font-size: 12px; }
.ii-picked.ok { color: var(--okc); font-weight: 700; }
.ii-picked.err { color: var(--dan); font-weight: 700; }

.ii-prev { margin-top: 10px; border: 2px solid var(--ink); padding: 10px 12px; background: var(--bg2); }
.ii-prev-row { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.ii-prev-row b.ok { color: var(--okc); }
.ii-prev-row b.warn { color: var(--acc); }
.ii-prev-list { margin-top: 10px; border-top: 1px dashed var(--line2); padding-top: 8px; }
.ii-prev-hd { font-size: 11px; color: var(--tx3); margin-bottom: 4px; }
.ii-prev-i { font-size: 12px; padding: 2px 0; }
.ii-how { color: var(--acc); font-weight: 700; font-size: 11px; }

.ii-bar { height: 14px; border: 2px solid var(--ink); background: var(--bg); margin-top: 10px; }
.ii-bar i { display: block; height: 100%; background: var(--acc); transition: width .15s linear; }
.ii-bar-tx { font-size: 12px; margin-top: 6px; line-height: 1.7; }
.ii-log {
  margin-top: 8px; max-height: 150px; overflow: auto; border: 1px solid var(--line2);
  padding: 6px 8px; background: var(--bg2); font-size: 11px; line-height: 1.75;
}
.ii-log-i.warn { color: #a34100; }
.ii-log-i.err { color: var(--dan); }
.ii-done { border: 2px solid var(--okc); padding: 12px; background: #f2fbf5; }
.ii-done-t { font-weight: 700; color: var(--okc); margin-bottom: 6px; }
.ii-done-b { font-size: 12px; line-height: 1.85; }
.ii-done-a { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   税务筹划视图（进项票页）
   ============================================================ */
.tax-card { margin-bottom: 12px; }
.tax-h { font-weight: 700; font-size: 13px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.tax-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tax-col { min-width: 0; }
.tax-t { font-size: 12px; font-weight: 700; color: var(--ink2); margin-bottom: 8px; }
.tax-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.tax-k { flex: 0 0 82px; }
.tax-bar { flex: 1; height: 10px; border: 1px solid var(--ink); background: var(--bg); min-width: 40px; }
.tax-bar i { display: block; height: 100%; background: var(--acc); }
.tax-v { flex: 0 0 96px; text-align: right; font-variant-numeric: tabular-nums; }
.tax-sum { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line3); }
.tax-sum b { font-variant-numeric: tabular-nums; }
.tax-note { font-size: 11px; color: var(--tx3); line-height: 1.7; margin-top: 8px; }
.tax-bad { color: var(--dan); margin-left: 6px; }
.tax-gap { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; gap: 8px; }
.tax-gap-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tax-gap-v { font-variant-numeric: tabular-nums; color: var(--dan); font-weight: 700; }
