/* ==========================================================================
   悍沃拖拉机 EPC 电子零件目录系统 — 现代化 UI 主题
   设计语言：工程蓝 + 清爽白 + 柔和灰，圆角卡片、柔和阴影、清晰层级
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root{
  /* 主色（工程蓝） */
  --primary:#2563eb;
  --primary-d:#1e50c8;
  --primary-deep:#163a94;
  --primary-soft:#eef4ff;
  --primary-ring:rgba(37,99,235,.16);

  /* 中性色 */
  --bg:#f4f6fa;
  --card:#ffffff;
  --line:#e2e8f0;
  --line-soft:#edf1f7;
  --text:#1b2437;
  --muted:#667085;

  /* 语义色 */
  --green:#16a34a;
  --green-d:#15803d;
  --green-soft:#e9f8ef;
  --amber:#d97706;
  --amber-soft:#fdf3e3;
  --danger:#dc2626;
  --danger-soft:#fdecec;
  --sky:#0ea5e9;

  /* 兼容旧变量 */
  --brand:#2563eb;
  --brand2:#1e50c8;
  --navy:#0d1c38;

  /* 阴影 / 圆角 */
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow-md:0 6px 18px rgba(16,24,40,.08);
  --shadow-lg:0 16px 44px rgba(16,24,40,.16);
  --r-sm:8px;
  --r-md:12px;
  --r-lg:16px;
}

html{ -webkit-text-size-adjust:100%; }
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Roboto,sans-serif;
  background:var(--bg); color:var(--text); font-size:14px; line-height:1.55;
}
::selection{ background:rgba(37,99,235,.22); }
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:#c4cedd; border-radius:8px; border:2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover{ background:#a7b4c9; }
button{ font-family:inherit; }
button:focus-visible, .nav-item:focus-visible, .tab:focus-visible, .cat-album-item:focus-visible{
  outline:2px solid var(--primary); outline-offset:2px; border-radius:var(--r-sm);
}

/* ---------- 通用工具类 ---------- */
.mono{ font-family:"Consolas","Courier New",monospace; font-size:12.5px; word-break:break-all; }
.muted{ color:var(--muted); padding:14px 4px; }
.sm{ font-size:12px; }
.star{ color:#b45309; font-size:11px; margin-left:2px; cursor:help; }
.hint{ font-size:12px; color:var(--muted); line-height:1.6; }
.warn{ color:var(--amber); }
.label{ font-size:13px; font-weight:600; color:var(--text); }
.nowrap{ white-space:nowrap; }
.chk{ display:inline-flex; align-items:center; gap:7px; font-size:13.5px; color:#3f4a5d; cursor:pointer; user-select:none; white-space:nowrap; }
.chk input{ width:15px; height:15px; accent-color:var(--primary); cursor:pointer; }

.badge-maint{ display:inline-block; margin-left:4px; padding:0 7px; font-size:11px; line-height:17px;
  color:#fff; background:#d97706; border-radius:999px; vertical-align:middle; }

.badge-rep{ display:inline-block; margin-left:4px; padding:0 7px; font-size:11px; line-height:17px;
  color:#fff; background:#2563eb; border-radius:999px; vertical-align:middle; cursor:pointer; transition:transform .05s, background .15s; }
.badge-rep:hover{ background:#1d4ed8; transform:translateY(-1px); }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(56,130,246,.38), transparent 60%),
    radial-gradient(760px 520px at 108% 112%, rgba(14,165,233,.30), transparent 58%),
    linear-gradient(160deg,#0b1d3e 0%,#123063 58%,#1e50c8 100%); }
.login-card{ background:var(--card); width:396px; max-width:100%; padding:36px 32px 30px; border-radius:20px;
  box-shadow:0 28px 80px rgba(4,14,40,.5); animation:cardIn .4s ease both; }
@keyframes cardIn{ from{ transform:translateY(14px); opacity:0; } to{ transform:none; opacity:1; } }
.login-logo{ font-size:22px; font-weight:800; color:var(--primary); letter-spacing:1px; }
.login-card h2{ margin:12px 0 2px; font-size:19px; color:var(--text); }
.login-sub{ color:var(--muted); font-size:12px; margin-bottom:20px; }
.login-card input{ width:100%; padding:11px 13px; margin-bottom:12px; border:1px solid var(--line);
  border-radius:10px; font-size:14px; outline:none; background:#fbfcfe; transition:border-color .15s, box-shadow .15s, background .15s; }
.login-card input:focus{ background:#fff; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-ring); }
.login-err{ color:var(--danger); font-size:12.5px; margin-bottom:8px; background:var(--danger-soft);
  border-radius:8px; padding:7px 10px; }
.btn-primary{ width:100%; padding:11px; background:var(--primary); color:#fff; border:none;
  border-radius:10px; font-size:15px; cursor:pointer; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  transition:background .15s, box-shadow .15s, transform .05s; box-shadow:0 1px 2px rgba(37,99,235,.3); }
.btn-primary:hover{ background:var(--primary-d); box-shadow:0 4px 12px rgba(37,99,235,.35); }
.btn-primary:active{ transform:translateY(1px); }
.btn-primary:disabled{ opacity:.55; cursor:default; box-shadow:none; }
.demo-box{ margin-top:18px; border-top:1px dashed var(--line); padding-top:14px; }
.demo-title{ font-size:12px; color:var(--muted); margin-bottom:8px; }
.demo-row{ display:flex; flex-wrap:wrap; gap:6px; }
.tag{ font-size:11.5px; padding:4px 9px; border-radius:999px; cursor:pointer; color:#fff; transition:transform .12s; }
.tag:hover{ transform:translateY(-1px); }
.tag-admin{ background:#334155; } .tag-mgr{ background:#d97706; } .tag-cust{ background:#0d9488; }
.demo-note{ font-size:11px; color:var(--muted); margin-top:8px; line-height:1.5; }

/* ==========================================================================
   主界面框架
   ========================================================================== */
.app-shell{ min-height:100vh; display:flex; flex-direction:column; }
.topbar{ height:58px; background:linear-gradient(90deg,#0c1c3a 0%,#122e60 70%,#163a8c 100%); color:#fff;
  display:flex; align-items:center; justify-content:space-between; padding:0 22px;
  box-shadow:0 2px 10px rgba(9,20,45,.28); position:relative; z-index:40; }
.brand{ font-weight:800; font-size:16.5px; letter-spacing:.4px; display:flex; align-items:center; gap:8px; }
.top-right{ display:flex; align-items:center; gap:12px; }
.who{ font-weight:600; font-size:13.5px; }
.role{ font-size:11px; padding:2px 9px; border-radius:999px; background:rgba(255,255,255,.18); font-weight:500; }
.role-admin{ background:#334155; } .role-manager{ background:#d97706; } .role-customer{ background:#0d9488; }
.topbar .btn-ghost{ background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.35); color:#fff;
  padding:5px 13px; border-radius:8px; cursor:pointer; font-size:12.5px; transition:.15s; }
.topbar .btn-ghost:hover{ background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.6); }
.body{ display:flex; flex:1; min-height:0; }
.sidenav{ width:188px; flex:0 0 188px; background:var(--card); border-right:1px solid var(--line);
  padding:14px 10px; display:flex; flex-direction:column; gap:2px; overflow-y:auto; }
.nav-item{ display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer; font-size:14px;
  border-radius:10px; color:#3f4a5d; position:relative; transition:background .14s, color .14s; }
.nav-ico{ font-size:16px; width:20px; text-align:center; flex:0 0 20px; }
.nav-item:hover{ background:#f1f5fb; color:var(--primary); }
.nav-item.active{ background:var(--primary-soft); color:var(--primary); font-weight:600; }
.nav-item.active::before{ content:""; position:absolute; left:-10px; top:22%; bottom:22%; width:4px;
  border-radius:0 4px 4px 0; background:var(--primary); }
.content{ flex:1; padding:20px 26px 32px; overflow:auto; min-width:0; }

/* ---------- 提示条 ---------- */
.banner{ background:var(--primary-soft); border:1px solid #cfe0ff; color:var(--primary-deep);
  padding:10px 14px; border-radius:10px; margin-bottom:14px; font-size:13px; line-height:1.6; }
.banner-info{ background:#eef6ff; border:1px solid #c8e2fb; color:#1d4e89;
  border-radius:10px; padding:10px 14px; font-size:13px; line-height:1.6; margin-bottom:12px; }

/* ---------- 工具栏 / 输入框 ---------- */
.toolbar{ display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.inp{ padding:9px 12px; border:1px solid var(--line); border-radius:9px; font-size:13.5px; outline:none;
  min-width:200px; background:var(--card); color:var(--text);
  transition:border-color .15s, box-shadow .15s; }
.inp::placeholder{ color:#9aa5b5; }
.inp:hover{ border-color:#c3cedd; }
.inp:focus{ border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-ring); }
select.inp{ min-width:130px; cursor:pointer; }
.inp.xs{ min-width:120px; width:120px; }
.toolbar .inp.xs{ padding:9px 10px; }
.inp.mini{ width:150px; min-width:0; padding:4px 8px; font-size:12px; border-radius:6px; }

.bom-combo{ position:relative; }
.bom-combo .inp{ min-width:300px; width:300px; }
.combo-list{ position:absolute; z-index:60; top:calc(100% + 6px); left:0; max-height:320px; overflow:auto;
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  box-shadow:var(--shadow-lg); margin:0; padding:6px; list-style:none; min-width:340px;
  animation:pop .14s ease; }
.combo-list li{ padding:9px 12px; border-radius:8px; cursor:pointer; font-size:13px;
  display:flex; flex-direction:column; gap:2px; transition:background .12s; }
.combo-list li.active, .combo-list li:hover{ background:var(--primary-soft); }
.combo-list li.active .bom-id-label, .combo-list li.active .bc-id,
.combo-list li:hover .bom-id-label, .combo-list li:hover .bc-id{ color:var(--primary); }
.combo-list li.active .bom-name-label, .combo-list li.active .bc-meta,
.combo-list li:hover .bom-name-label, .combo-list li:hover .bc-meta{ color:var(--primary-d); }
.combo-list .bc-id, .combo-list .bom-id-label{ font-weight:700; color:#253149; }
.combo-list .bc-meta, .combo-list .bom-name-label{ font-size:11.5px; color:var(--muted); }
.combo-list .combo-empty{ color:var(--muted); cursor:default; padding:9px 12px; font-size:12.5px; }
.count{ color:var(--muted); font-size:13px; margin-left:auto; }
.maint-note{ color:var(--muted); font-size:12px; margin:-6px 0 10px; padding:7px 11px;
  background:#f7f9fc; border:1px solid var(--line-soft); border-radius:8px; }
.sub-toolbar{ border-radius:10px; }

/* ==========================================================================
   表格
   ========================================================================== */
.tbl{ width:100%; border-collapse:separate; border-spacing:0; background:var(--card);
  border:1px solid var(--line); border-radius:12px; overflow:hidden; box-shadow:var(--shadow-sm); }
.tbl th{ background:#f7f9fc; text-align:left; padding:11px 13px; font-size:12.5px; color:#4a5568;
  font-weight:600; border-bottom:1px solid var(--line); white-space:nowrap;
  position:sticky; top:0; z-index:2; }
.tbl td{ padding:10px 13px; border-bottom:1px solid var(--line-soft); font-size:13px; vertical-align:middle; }
.tbl tbody tr:last-child td{ border-bottom:none; }
.tbl tbody tr{ cursor:pointer; transition:background .1s; }
.tbl tbody tr:nth-child(even){ background:#fafbfd; }
.tbl tbody tr:hover{ background:#f1f6ff; }
.tbl.small td{ padding:7px 9px; font-size:12px; }
.tbl .empty{ text-align:center; color:var(--muted); padding:26px; }
.tbl th.num, .tbl td.num{ text-align:right; font-variant-numeric:tabular-nums; }
.admin-tbl tbody tr{ cursor:default; }

/* 零件查询表：零件编码列宽度（按需求可微调），其后各列适当收窄 */
.parts-tbl{ table-layout:fixed; }
.parts-tbl th:nth-child(1), .parts-tbl td:nth-child(1){ width:110px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.parts-tbl th:nth-child(2), .parts-tbl td:nth-child(2){ width:auto; }            /* 名称 */
.parts-tbl th:nth-child(3), .parts-tbl td:nth-child(3){ width:120px; }            /* 英文名称 */
.parts-tbl th:nth-child(4), .parts-tbl td:nth-child(4){ width:auto; }             /* 规格型号 */
.parts-tbl th:nth-child(5), .parts-tbl td:nth-child(5){ width:52px; }              /* 单位 */
.parts-tbl th:nth-child(6), .parts-tbl td:nth-child(6){ width:96px; overflow:hidden; text-overflow:ellipsis; } /* 分组 */
.parts-tbl th:nth-child(7), .parts-tbl td:nth-child(7),
.parts-tbl th:nth-child(8), .parts-tbl td:nth-child(8),
.parts-tbl th:nth-child(9), .parts-tbl td:nth-child(9),
.parts-tbl th:nth-child(10), .parts-tbl td:nth-child(10){ width:58px; }           /* 重量/长/宽/高 */
.parts-tbl th:nth-child(11), .parts-tbl td:nth-child(11){ width:90px; text-align:right; } /* 价格 */
.parts-tbl th:nth-child(12), .parts-tbl td:nth-child(12){ width:140px; text-align:center; white-space:nowrap; } /* 操作 */
.parts-tbl td:nth-child(12){ padding-left:8px; padding-right:8px; }
.parts-tbl td:nth-child(12) .btn-mini{ display:inline-block; vertical-align:middle; }
.parts-tbl td:nth-child(12) .btn-mini:first-child{ margin-right:6px; }
.parts-tbl td:nth-child(6){ white-space:nowrap; }
.yes{ color:var(--green-d); font-weight:600; } .no{ color:#b0b8c3; }

/* 徽章 */
.badge{ font-size:11px; background:#eef1f6; color:#44505f; border:1px solid #d4dce8;
  padding:1px 9px; border-radius:999px; white-space:nowrap; }
.badge-ok{ font-size:11px; background:var(--green-soft); color:var(--green-d);
  padding:1px 8px; border-radius:999px; border:1px solid #bfe7cd; white-space:nowrap; }
.badge-warn{ font-size:11px; background:var(--amber-soft); color:var(--amber);
  padding:1px 8px; border-radius:999px; border:1px solid #f2d7ab; white-space:nowrap; }
.badge-info{ background:#eef1f6; color:#44505f; border:1px solid #d4dce8; border-radius:999px; padding:1px 9px; font-size:12px; }
.badge-fuzzy{ font-size:11px; background:var(--primary-soft); color:var(--primary);
  border:1px solid #cfe0ff; padding:1px 9px; border-radius:999px; margin-left:10px; white-space:nowrap; }

/* 分页 */
.pager{ display:flex; gap:14px; align-items:center; justify-content:center; margin-top:16px; }
.pager button{ padding:6px 15px; border:1px solid var(--line); background:var(--card); border-radius:9px;
  cursor:pointer; color:#3f4a5d; font-size:13px; transition:.15s; }
.pager button:hover:not(:disabled){ border-color:var(--primary); color:var(--primary); background:var(--primary-soft); }
.pager button:disabled{ opacity:.45; cursor:default; }
.pager span{ color:var(--muted); font-size:13px; }

/* ==========================================================================
   抽屉
   ========================================================================== */
.drawer-mask{ position:fixed; inset:0; background:rgba(10,20,40,.45); backdrop-filter:blur(2px);
  display:flex; justify-content:flex-end; z-index:50; }
.drawer{ width:640px; max-width:94vw; background:var(--card); height:100%; display:flex; flex-direction:column;
  box-shadow:-10px 0 36px rgba(4,14,40,.28); animation:slide .22s ease; }
@keyframes slide{ from{ transform:translateX(48px); opacity:.5; } to{ transform:none; opacity:1; } }
.drawer-head{ display:flex; justify-content:space-between; align-items:center; padding:17px 22px;
  border-bottom:1px solid var(--line); background:#fbfcfe; }
.drawer-head h3{ font-size:16px; color:var(--text); }
.drawer-body{ padding:18px 22px; overflow:auto; flex:1; }
.kv-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px 20px; margin-bottom:18px;
  background:#f8fafd; border:1px solid var(--line-soft); border-radius:12px; padding:14px 16px; }
.kv-grid div{ display:flex; flex-direction:column; min-width:0; }
.kv-grid label{ font-size:11.5px; color:var(--muted); margin-bottom:3px; }
.kv-grid span{ font-size:13.5px; word-break:break-all; }
.sec-title{ font-size:14px; font-weight:700; margin:16px 0 10px; color:var(--primary-deep);
  border-left:3px solid var(--primary); padding-left:9px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.bom-id{ font-size:11.5px; background:var(--primary-soft); color:var(--primary-d); padding:2px 8px;
  border-radius:6px; font-weight:400; border:1px solid #dbe7ff; }

/* ==========================================================================
   BOM 树
   ========================================================================== */
.bom-tree{ font-size:13px; }
.bom-node{ margin-left:0; }
.bom-row{ display:flex; align-items:center; gap:6px; padding:4px 8px; border-radius:7px; transition:background .1s; }
.bom-row:hover{ background:#f1f6ff; }
.tw{ cursor:pointer; width:16px; display:inline-block; text-align:center; color:var(--primary); user-select:none; }
.bom-code{ font-family:Consolas,monospace; font-size:12px; color:#4a5568; }
.bom-name{ font-weight:500; }
.bom-spec{ color:var(--muted); font-size:11.5px; }
.bom-meta{ color:var(--muted); font-size:11px; margin-left:auto; }

/* ==========================================================================
   标签页（分段控件风格）
   ========================================================================== */
.tabs{ display:flex; flex-wrap:wrap; gap:4px; margin-bottom:14px; padding:5px;
  background:#e9edf5; border-radius:12px; width:max-content; max-width:100%; }
.tab{ padding:7px 15px; border-radius:9px; cursor:pointer; font-size:13.5px; color:#4b5565;
  border:1px solid transparent; font-weight:500; transition:.15s; white-space:nowrap; }
.tab:hover{ color:var(--primary); background:rgba(255,255,255,.75); }
.tab.active{ background:var(--card); color:var(--primary); border-color:var(--line);
  font-weight:600; box-shadow:var(--shadow-sm); }

/* ==========================================================================
   弹窗
   ========================================================================== */
.modal-mask{ position:fixed; inset:0; background:rgba(10,20,40,.5); backdrop-filter:blur(2px);
  display:flex; align-items:center; justify-content:center; z-index:70; padding:20px; }
.modal{ width:640px; max-width:94vw; max-height:90vh; background:var(--card); border-radius:16px;
  display:flex; flex-direction:column; box-shadow:var(--shadow-lg); animation:pop .16s ease; }
@keyframes pop{ from{ transform:scale(.96) translateY(6px); opacity:.5; } to{ transform:none; opacity:1; } }
.modal.wide{ width:880px; max-width:94vw; }
.modal-head{ display:flex; justify-content:space-between; align-items:center; padding:16px 22px;
  border-bottom:1px solid var(--line); background:#fbfcfe; border-radius:16px 16px 0 0; }
.modal-head h3{ font-size:16px; color:var(--text); }
.modal-head .btn-ghost{ background:transparent; border:none; color:var(--muted); font-size:18px;
  padding:4px 8px; border-radius:8px; line-height:1; }
.modal-head .btn-ghost:hover{ background:#eef1f6; color:var(--text); }
.modal-body{ padding:18px 22px; overflow:auto; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:13px 18px; }
.grid2 label{ display:flex; flex-direction:column; font-size:12px; color:#4a5568; gap:5px; font-weight:500; }
.grid2 input, .grid2 select, .grid2 textarea{ padding:8px 11px; border:1px solid var(--line); border-radius:9px;
  font-size:13.5px; outline:none; background:#fbfcfe; transition:.15s; font-family:inherit; width:100%; }
.grid2 input:focus, .grid2 select:focus, .grid2 textarea:focus{ background:#fff; border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-ring); }
.grid2 input:disabled{ background:#f1f3f7; color:var(--muted); cursor:default; }
.grid2 .col-span, label.full{ grid-column:1 / -1; }
.modal-foot{ display:flex; justify-content:flex-end; gap:10px; padding:14px 22px;
  border-top:1px solid var(--line); background:#fbfcfe; border-radius:0 0 16px 16px; }
.modal-foot .btn-primary{ width:auto; padding:9px 20px; font-size:13.5px; }
.modal-foot .btn-ghost{ width:auto; padding:9px 18px; font-size:13.5px; }
.modal-tip{ font-size:13px; color:#4a5568; line-height:1.7; margin:0 0 16px;
  background:#f7f9fc; border:1px solid var(--line-soft); border-radius:10px; padding:10px 13px; }
.modal-tip b{ color:var(--primary-d); }
.modal-tip code{ background:var(--primary-soft); padding:1px 6px; border-radius:5px; font-size:12px; color:var(--primary-d); }
.modal-tip.warn{ background:var(--amber-soft); border-color:#f2d7ab; color:#8a5307; }
.modal-actions{ display:flex; gap:12px; justify-content:center; padding:6px 0 4px; flex-wrap:wrap; }
.modal-actions .btn-primary{ width:auto; padding:10px 24px; font-size:14px; }
.modal-actions .btn-ghost{ width:auto; padding:10px 22px; font-size:14px; }

/* ==========================================================================
   按钮体系
   ========================================================================== */
.btn-ghost{ background:var(--card); border:1px solid var(--line); color:#3f4a5d;
  padding:5px 13px; border-radius:8px; cursor:pointer; font-size:12.5px; font-weight:500;
  display:inline-flex; align-items:center; justify-content:center; gap:5px; transition:.15s; }
.btn-ghost:hover{ border-color:var(--primary); color:var(--primary); background:var(--primary-soft); }
.btn-ghost:disabled{ opacity:.5; cursor:default; }
.btn-ghost:disabled:hover{ border-color:var(--line); color:#3f4a5d; background:var(--card); }
.btn-ghost.mini, .btn-primary.mini{ padding:4px 12px; font-size:12px; }

/* 工具栏按钮（覆盖登录态全宽） */
.toolbar .btn-primary{ width:auto; padding:9px 17px; font-size:13.5px; }
.toolbar .btn-ghost{ width:auto; padding:9px 15px; font-size:13.5px; }

/* 表内小按钮 */
.btn-mini{ padding:4px 11px; border:1px solid var(--line); background:var(--card); border-radius:7px;
  cursor:pointer; font-size:12px; margin-right:4px; color:#3f4a5d; transition:.14s; }
.btn-mini:hover{ background:#f1f5fb; border-color:var(--primary); color:var(--primary); }
.btn-mini.primary{ color:var(--primary-d); border-color:#b9d0f8; background:var(--primary-soft); }
.btn-mini.primary:hover{ background:var(--primary); color:#fff; border-color:var(--primary); }
.btn-mini.danger{ color:var(--danger); border-color:#f2c4c4; }
.btn-mini.danger:hover{ background:var(--danger-soft); border-color:var(--danger); color:var(--danger); }
.btn-link{ background:none; border:none; color:var(--primary); cursor:pointer; font-size:11.5px;
  padding:0 4px; text-decoration:none; }
.btn-link:hover{ color:var(--primary-d); text-decoration:underline; }

/* 语言切换按钮(中/EN) */
.login-top{ display:flex; align-items:center; justify-content:space-between; }
.login-lang{ display:flex; gap:4px; }
.lang-btn{ border:1px solid #b9d0f8; background:#fff; color:var(--primary); border-radius:7px;
  padding:3px 10px; font-size:12px; cursor:pointer; line-height:1.4; margin-left:6px; font-weight:600; transition:.15s; }
.lang-btn:hover{ background:var(--primary-soft); }
.lang-btn.on{ background:var(--primary); border-color:var(--primary); color:#fff; }

/* ==========================================================================
   图册：专辑体系
   ========================================================================== */
.cat-layout{ display:flex; gap:16px; align-items:flex-start; }
.cat-albums{ width:252px; flex:0 0 252px; background:var(--card); border:1px solid var(--line);
  border-radius:12px; padding:12px; max-height:76vh; overflow:auto; box-shadow:var(--shadow-sm); }
.cat-albums-head{ display:flex; gap:6px; margin-bottom:10px; }
.cat-albums-head .inp.sm{ flex:1; min-width:0; width:auto; padding:6px 9px; font-size:12.5px;
  border:1px solid var(--line); border-radius:8px; }
.cat-albums-head .btn-mini{ padding:4px 8px; flex:0 0 auto; white-space:nowrap; }
.cat-album-list{ display:flex; flex-direction:column; gap:8px; }
.cat-album-item{ border:1px solid var(--line); border-radius:10px; padding:9px 11px; cursor:pointer;
  transition:.15s; background:var(--card); }
.cat-album-item:hover{ border-color:#b9d0f8; box-shadow:var(--shadow-sm); }
.cat-album-item.active{ border-color:var(--primary); background:var(--primary-soft); box-shadow:inset 0 0 0 1px var(--primary); }
.cat-album-item.lvl2{ padding:7px 10px; }
.ca-key{ font-size:12.5px; font-weight:700; color:var(--primary-d); }
.ca-title{ font-size:13px; margin:2px 0; color:var(--text); font-weight:500; }
.ca-sub{ margin:3px 0; display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.ca-meta{ font-size:11.5px; color:var(--muted); }

/* 一级目录(导入包)分组树 */
.pkg-group-head{ display:flex; flex-direction:column; gap:4px; padding:7px 9px; margin-top:4px;
  background:#f5f8fc; border:1px solid var(--line); border-radius:10px; font-weight:700; font-size:13px; color:var(--text); }
.pkg-title-row{ display:flex; align-items:center; gap:6px; cursor:pointer; }
.pkg-title-row:hover{ color:var(--primary); }
.pkg-caret{ width:14px; text-align:center; color:var(--muted); flex-shrink:0; }
.pkg-name{ flex:1; min-width:0; white-space:normal; word-break:break-word; line-height:1.3; }
.pkg-count{ font-size:11px; background:#e2e8f2; color:#3f4a5d; padding:0 7px; border-radius:999px; font-weight:600; flex-shrink:0; }
.pkg-actions{ display:flex; gap:10px; padding-left:20px; }
.pkg-actions .btn-link, .pkg-actions .btn-mini{ white-space:nowrap; padding:2px 6px; font-size:12px; }
.pkg-children{ display:flex; flex-direction:column; gap:6px; padding:6px 0 2px 12px;
  border-left:2px solid var(--line); margin-left:7px; }

/* 右侧：图册浏览 */
.cat-main{ flex:1; min-width:0; }
.cat-pkg-bar, .cat-match-bar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px;
  background:var(--card); border:1px solid var(--line); border-radius:10px; padding:8px 13px; box-shadow:var(--shadow-sm); }
.pkg-msg{ font-size:12.5px; padding:3px 11px; border-radius:999px; background:#eef1f6; color:#44505f; }
.pkg-msg.done{ background:var(--green-soft); color:var(--green-d); }

.cat-imgs-bar{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.cat-thumb{ width:98px; height:98px; border:1px solid var(--line); border-radius:10px; overflow:hidden;
  cursor:pointer; position:relative; background:var(--card); transition:.14s; box-shadow:var(--shadow-sm); }
.cat-thumb:hover{ border-color:#b9d0f8; transform:translateY(-2px); }
.cat-thumb img{ width:100%; height:75px; object-fit:cover; display:block; }
.cat-thumb-name{ display:block; font-size:10.5px; text-align:center; padding:2px 3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#4a5568; }
.cat-thumb.active{ border-color:var(--primary); box-shadow:0 0 0 2px var(--primary); }
.cat-thumb.add{ display:flex; align-items:center; justify-content:center; color:var(--primary);
  font-size:13px; border-style:dashed; }

.cat-viewer{ display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.cat-canvas{ position:relative; display:inline-block; border:1px solid var(--line); border-radius:12px;
  background:var(--card); max-width:100%; flex:1 1 auto; min-width:0; box-shadow:var(--shadow-sm); }
.cat-big{ display:block; width:100%; height:auto; max-height:88vh; cursor:zoom-in; border-radius:12px; }
.callout{ position:absolute; transform:translate(-50%,-50%); background:var(--primary); color:#fff; font-size:11px;
  width:20px; height:20px; line-height:16px; text-align:center; border-radius:50%; cursor:pointer;
  box-shadow:0 1px 6px rgba(37,99,235,.5); border:2px solid #fff; }
.callout.hl{ background:#ea580c; transform:translate(-50%,-50%) scale(1.25); z-index:3; }
.callout.pending{ background:var(--sky); }

.cat-legend{ flex:1; min-width:250px; background:var(--card); border:1px solid var(--line);
  border-radius:12px; padding:13px; box-shadow:var(--shadow-sm); }
.cat-legend-head{ display:flex; justify-content:space-between; align-items:center; font-size:13px;
  font-weight:700; margin-bottom:9px; color:var(--text); }
.cat-legend-ops .btn-mini{ margin-left:4px; }
.cat-legend-list{ display:flex; flex-direction:column; gap:6px; max-height:60vh; overflow:auto; }
.lg-item{ display:flex; gap:8px; align-items:center; padding:7px 9px; border:1px solid var(--line);
  border-radius:8px; cursor:pointer; font-size:12.5px; transition:.13s; }
.lg-item:hover{ border-color:#b9d0f8; background:#f7faff; }
.lg-item.hl{ border-color:#f2b98f; background:#fff6ef; }
.lg-no{ font-weight:700; color:var(--primary-d); min-width:22px; }
.lg-part{ color:var(--text); }

/* 旧版图册卡片(兼容) */
.catalog-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; }
.catalog-card{ background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden;
  display:flex; flex-direction:column; box-shadow:var(--shadow-sm); transition:.16s; }
.catalog-card:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); }
.cat-page-no{ background:#f7f9fc; padding:8px 13px; font-size:12.5px; font-weight:600; color:#4a5568;
  border-bottom:1px solid var(--line-soft); }
.cat-img{ width:100%; cursor:zoom-in; border-bottom:1px solid var(--line); background:#fafbfd; }
.cat-snip{ padding:9px 13px; font-size:11.5px; color:var(--muted); line-height:1.5; max-height:72px; overflow:hidden; }
.zoom-mask{ position:fixed; inset:0; background:rgba(8,16,34,.9); display:flex; align-items:center;
  justify-content:center; z-index:60; cursor:zoom-out; }
.zoom-img{ max-width:94vw; max-height:94vh; box-shadow:0 10px 44px rgba(0,0,0,.6); border-radius:4px; }
.cat-title{ padding:9px 13px 2px; font-size:13.5px; font-weight:600; color:var(--text); }
.cat-ops{ padding:8px 13px 12px; display:flex; gap:6px; }
.cat-ops .btn-mini{ margin-right:0; }
.bom-link{ cursor:pointer; font-size:12px; margin-left:6px; color:var(--primary); }
.bom-link:hover{ transform:scale(1.2); }

/* ==========================================================================
   标号编辑器 / 批量对准 / 导入
   ========================================================================== */
.co-editor{ display:flex; gap:18px; align-items:flex-start; }
.co-canvas{ position:relative; border:1px solid var(--line); border-radius:12px; background:var(--card);
  flex:1; min-width:0; cursor:crosshair; }
.co-canvas img{ display:block; max-width:100%; max-height:60vh; }
.co-side{ width:300px; flex:0 0 300px; display:flex; flex-direction:column; gap:10px; }
.co-hint{ font-size:12.5px; color:var(--muted); background:#f7f9fc; padding:8px 11px;
  border:1px solid var(--line-soft); border-radius:8px; }
.co-form label, .co-imgname label{ display:flex; flex-direction:column; font-size:12px; color:#4a5568; gap:4px; margin-bottom:8px; }
.co-form input, .co-form select, .co-imgname input{ padding:7px 10px; border:1px solid var(--line);
  border-radius:8px; font-size:13px; transition:.15s; }
.co-form input:focus, .co-form select:focus, .co-imgname input:focus{ border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-ring); outline:none; }
.co-form-actions{ display:flex; gap:8px; }
.co-form-actions .btn-primary, .co-form-actions .btn-ghost{ width:auto; padding:8px 14px; font-size:13px; }
.co-list{ border-top:1px solid var(--line); padding-top:8px; max-height:34vh; overflow:auto; }
.co-row{ display:flex; align-items:center; gap:8px; padding:5px 2px; font-size:12.5px; border-bottom:1px dashed var(--line); }
.co-no{ font-weight:700; color:var(--primary-d); min-width:24px; }
.co-code{ flex:1; color:var(--text); word-break:break-all; }
.co-st{ font-size:11.5px; color:var(--muted); margin-left:auto; }

.co-align-banner{ background:#fff5e8; border:1px solid #f2d7ab; color:#8a5307; padding:9px 13px;
  border-radius:10px; font-size:13px; margin-bottom:10px; display:flex; align-items:center; gap:10px; }
.co-align-banner b{ color:#c2410c; font-size:14px; }
.co-align-list{ border:1px dashed #b9d0f8; border-radius:10px; padding:8px; background:#f7faff; margin-bottom:8px; }
.co-align-list .co-row.align{ cursor:pointer; border-radius:7px; }
.co-align-list .co-row.align.active{ background:var(--primary); color:#fff; }
.co-align-list .co-row.align.active .co-no{ color:#fff; }
.co-align-list .co-row.align.active .co-code{ color:#e8f0ff; }
.co-align-list .co-row.align.done .co-st{ color:var(--green-d); font-weight:600; }

.co-import{ border:1px solid var(--line); border-radius:10px; padding:11px; background:#fafbfd; }
.co-import-bar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.co-import-bar .link{ color:var(--primary); font-size:12.5px; cursor:pointer; text-decoration:underline; }
.co-import-bar input[type=file]{ font-size:12px; max-width:200px; }
.co-import-bar .ck{ font-size:12px; color:#4a5568; display:flex; align-items:center; gap:4px; }
.co-import-preview{ max-height:34vh; overflow:auto; margin-bottom:8px; border:1px solid var(--line); border-radius:8px; }
.co-import-preview .tbl.sm th, .co-import-preview .tbl.sm td{ padding:5px 8px; font-size:12px; }
.co-import-msg{ font-size:12.5px; padding:7px 11px; border-radius:8px; background:#eef1f6; color:#44505f; }
.co-import-msg.done{ background:var(--green-soft); color:var(--green-d); }

/* ==========================================================================
   BOM 清洗
   ========================================================================== */
.clean-rules{ margin-top:14px; padding:15px 17px; background:var(--card); border:1px solid var(--line);
  border-radius:12px; box-shadow:var(--shadow-sm); }
.clean-rules h4{ margin:0 0 8px; font-size:13px; color:var(--text); font-weight:700; }
.clean-rules h4.mt{ margin-top:16px; }
.kw-actions{ display:flex; align-items:center; gap:10px; margin-top:10px; flex-wrap:wrap; }
.rules-msg{ margin-top:8px; color:var(--amber); }
.clean-3col{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; margin-top:12px; }
.clean-box{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:13px 15px;
  box-shadow:var(--shadow-sm); min-width:0; }
.clean-box h4{ font-size:13px; font-weight:700; margin-bottom:9px; color:var(--text); }
.clean-box .tbl.mini th, .clean-box .tbl.mini td{ padding:6px 9px; font-size:12px; }

/* ==========================================================================
   数据看板
   ========================================================================== */
.kpi-row{ display:grid; grid-template-columns:repeat(6,1fr); gap:14px; margin-bottom:18px; }
.kpi-card{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:17px 15px;
  box-shadow:var(--shadow-sm); position:relative; overflow:hidden; transition:.18s; }
.kpi-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); }
.kpi-card::before{ content:""; position:absolute; left:0; right:0; top:0; height:4px; background:var(--kc,var(--primary)); }
.kpi-card:nth-child(1){ --kc:#2563eb; }
.kpi-card:nth-child(2){ --kc:#7c3aed; }
.kpi-card:nth-child(3){ --kc:#0891b2; }
.kpi-card:nth-child(4){ --kc:#16a34a; }
.kpi-card:nth-child(5){ --kc:#d97706; }
.kpi-card:nth-child(6){ --kc:#e11d48; }
.kpi-num{ font-size:27px; font-weight:800; line-height:1.1; letter-spacing:-.4px; font-variant-numeric:tabular-nums; }
.kpi-lbl{ font-size:12.5px; color:var(--muted); margin-top:5px; }
.chart-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.chart-box{ background:var(--card); border:1px solid var(--line); border-radius:14px;
  padding:15px 18px; box-shadow:var(--shadow-sm); }
.chart-box.wide{ grid-column:1 / -1; }
.chart-box h4{ margin:0 0 10px; font-size:14px; color:var(--text); font-weight:700; }
.chart{ width:100%; height:300px; }

/* ==========================================================================
   购物车 / 订单 / 提示
   ========================================================================== */
.cart-fab{ position:fixed; right:24px; bottom:24px; z-index:60; width:58px; height:58px; border-radius:50%;
  background:linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; font-size:24px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow:0 10px 26px rgba(37,99,235,.45); transition:transform .14s, box-shadow .14s; user-select:none; }
.cart-fab:hover{ transform:scale(1.07); box-shadow:0 12px 32px rgba(37,99,235,.55); }
.cart-badge{ position:absolute; top:-6px; right:-6px; background:var(--danger); color:#fff; font-size:12px;
  min-width:21px; height:21px; border-radius:999px; padding:0 6px; display:flex; align-items:center;
  justify-content:center; font-weight:700; border:2px solid #fff; }
.cart-drawer{ max-width:480px; width:92%; }
.cart-cust{ background:#f8fafd; border:1px solid var(--line-soft); border-radius:10px; padding:11px 13px; margin-bottom:12px; }
.cart-cust label{ display:block; font-size:12px; color:#4a5568; margin-bottom:4px; font-weight:500; }
.cart-cust select, .cart-cust input{ width:100%; margin-bottom:8px; }
.cart-country{ display:flex; align-items:center; gap:8px; font-size:12px; color:#4a5568; margin-bottom:8px; }
.drawer-foot{ display:flex; gap:10px; justify-content:flex-end; padding:13px 16px; border-top:1px solid var(--line); background:#fbfcfe; }
.drawer-foot .btn-primary{ flex:1; width:auto; }
.drawer-foot .btn-ghost{ width:auto; }
.toast{ position:fixed; left:50%; top:20px; transform:translateX(-50%); z-index:80; background:var(--green-d);
  color:#fff; padding:9px 20px; border-radius:999px; font-size:13px;
  box-shadow:0 8px 24px rgba(22,101,52,.4); animation:toastIn .25s ease; }
@keyframes toastIn{ from{ transform:translate(-50%,-12px); opacity:0; } to{ transform:translate(-50%,0); opacity:1; } }

/* 订单核对摘要 / 空状态 */
.summary{ background:var(--primary-soft); border:1px solid #cfe0ff; color:var(--primary-deep);
  border-radius:10px; padding:10px 14px; font-size:13px; margin-bottom:10px; line-height:1.6; }
.empty-box{ border:1.5px dashed #c6d0e0; background:#fbfcfe; border-radius:12px; padding:46px 20px;
  text-align:center; color:var(--muted); font-size:13.5px; }
.empty-hint{ text-align:center; }
.subcard{ margin-top:18px; background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:15px 17px; box-shadow:var(--shadow-sm); }
.subcard h4{ font-size:13.5px; font-weight:700; margin-bottom:8px; }

/* 图册-BOM 关联弹窗 */
.sub-h{ font-size:12.5px; color:#4a5568; margin:6px 0 8px; font-weight:600; }
.blk{ display:block; font-size:12.5px; color:#4a5568; margin-bottom:12px; }
.blk input[type=file]{ margin-top:6px; font-size:12.5px; }
.bom-pick{ max-height:300px; overflow:auto; border:1px solid var(--line); border-radius:10px;
  padding:8px 10px; background:#fafbfd; }
.bom-pick .bom-opt{ display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:7px; font-size:13px; cursor:pointer; }
.bom-pick .bom-opt:hover{ background:var(--primary-soft); }
.bom-pick .bom-opt .mono{ color:var(--primary-d); font-weight:600; }
.pkg-bom-toolbar{ background:#f7f9fc; border:1px solid var(--line-soft); border-radius:10px; padding:10px 13px; margin-bottom:12px; }
.pkg-bom-toolbar .muted{ display:block; margin-bottom:6px; padding:0; }
.pkg-bom-toolbar .inp{ margin-bottom:8px; }
.pkg-bom-list{ max-height:46vh; overflow:auto; border:1px solid var(--line); border-radius:10px; background:var(--card); }
.pkg-bom-row{ padding:9px 13px; border-bottom:1px solid var(--line-soft); }
.pkg-bom-row:last-child{ border-bottom:none; }
.pbr-head{ display:flex; align-items:center; gap:8px; }
.pbr-head .ca-title{ color:var(--muted); font-size:12.5px; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0; }
.bom-badges{ display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }

/* 零件明细面板(图册拆分) */
.cat-parts{ margin-top:14px; background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:13px; box-shadow:var(--shadow-sm); }
.cat-parts-head{ display:flex; justify-content:space-between; align-items:center; font-size:13px; font-weight:700; margin-bottom:8px; }
.cat-parts .tbl.sm th, .cat-parts .tbl.sm td{ padding:6px 8px; font-size:12px; }
.cat-parts tbody tr.matched{ background:var(--green-soft); }
.cat-parts tbody tr.matched td .mono{ color:var(--green-d); font-weight:600; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media(max-width:860px){
  .kpi-row{ grid-template-columns:repeat(3,1fr); }
  .chart-grid{ grid-template-columns:1fr; }
  .clean-3col{ grid-template-columns:1fr; }
  /* 移动端: 侧边导航转为顶部横向滚动条, 内容在下方 */
  .body{ flex-direction:column; }
  .sidenav{ width:100%; flex:0 0 auto; border-right:none; border-bottom:1px solid var(--line);
    display:flex; flex-direction:row; overflow-x:auto; padding:6px 8px; gap:4px; white-space:nowrap; }
  .sidenav .nav-item{ padding:9px 13px; font-size:13.5px; border-radius:9px; }
  .sidenav .nav-item.active::before{ display:none; }
  .sidenav .nav-item.active{ box-shadow:inset 0 -3px 0 var(--primary); background:var(--primary-soft); }
  .topbar{ flex-wrap:wrap; height:auto; padding:10px 14px; gap:8px; }
  .topbar .brand{ font-size:14.5px; }
  .topbar .who{ font-size:12.5px; }
  .content{ padding:12px; overflow-x:auto; }
  .toolbar{ gap:8px; }
  .toolbar .inp{ flex:1 1 100%; min-width:0; }
  .bom-combo{ flex:1 1 100%; }
  .bom-combo .inp{ width:100%; min-width:0; }
  .toolbar .btn-primary, .toolbar .btn-ghost{ flex:1 1 auto; }
  .tbl{ font-size:12px; min-width:540px; }
  .tbl th, .tbl td{ padding:8px 9px; }
  .drawer{ width:100%; max-width:100%; height:100%; border-radius:0; }
  .modal{ width:100%; max-width:100%; height:100%; border-radius:0; }
  .modal-body{ max-height:none; }
  .login-wrap{ align-items:flex-start; padding:16px; }
  .login-card{ width:100%; padding:26px 20px; margin-top:18px; }
  .cat-layout{ flex-direction:column; }
  .cat-albums{ width:100%; flex:0 0 auto; max-height:34vh; }
  .co-editor{ flex-direction:column; }
  .co-side{ width:100%; flex:0 0 auto; }
}
@media(max-width:480px){
  .kpi-row{ grid-template-columns:repeat(2,1fr); }
  .topbar .who{ display:none; }
  .topbar .lang-btn{ padding:2px 7px; }
  .grid2{ grid-template-columns:1fr; }
}

/* ===== AI 智能助手 ===== */
.view-title{ font-size:18px; font-weight:700; margin:0 0 14px; color:var(--text); }
.ai-answer{ margin-top:12px; padding:14px 16px; background:var(--card); border:1px solid var(--line); border-radius:12px; white-space:pre-wrap; line-height:1.7; font-size:14px; color:var(--text); max-height:420px; overflow:auto; }
.ai-hits{ margin-top:10px; padding:8px 12px; background:var(--card); border:1px dashed var(--line); border-radius:10px; font-size:13px; display:flex; align-items:center; flex-wrap:wrap; row-gap:4px; }
.seg{ display:inline-flex; border:1px solid var(--line); border-radius:9px; overflow:hidden; }
.seg-btn{ border:0; background:var(--card); color:var(--muted); padding:9px 14px; cursor:pointer; font-size:13px; }
.seg-btn.on{ background:var(--primary); color:#fff; }
.seg-btn + .seg-btn{ border-left:1px solid var(--line); }
.badge.yes{ background:var(--green-soft); color:var(--green-d); border:1px solid var(--green-d); }
.badge.no{ background:var(--amber-soft); color:var(--amber); border:1px solid var(--amber); }

/* ===== 悬浮智能助手(多轮对话 + 结构化结果) ===== */
.ai-fab{ position:fixed; left:24px; bottom:28px; width:54px; height:54px; border-radius:50%;
  background:var(--primary); color:#fff; font-size:24px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; box-shadow:0 8px 22px rgba(37,99,235,.38); z-index:1200; user-select:none;
  transition:transform .12s, box-shadow .12s; }
.ai-fab:hover{ transform:translateY(-2px); box-shadow:0 12px 28px rgba(37,99,235,.46); }
.ai-chat{ position:fixed; left:24px; bottom:28px; width:540px; max-width:calc(100vw - 32px);
  height:600px; max-height:calc(100vh - 56px); background:var(--card); border:1px solid var(--line);
  border-radius:var(--r-lg); box-shadow:var(--shadow-lg); z-index:1200;
  display:flex; flex-direction:column; overflow:hidden; }
.ai-chat.mini{ height:auto; }
.ai-chat-head{ display:flex; align-items:center; gap:6px; padding:11px 13px; background:var(--primary); color:#fff; }
.ai-chat-title{ font-size:14px; font-weight:600; }
.ai-icon-btn{ background:transparent; border:0; color:#fff; font-size:15px; cursor:pointer; padding:2px 7px; border-radius:6px; line-height:1.4; }
.ai-icon-btn:hover{ background:rgba(255,255,255,.2); }
.ai-chat-tabs{ display:flex; align-items:center; gap:6px; padding:8px 10px; border-bottom:1px solid var(--line); background:var(--primary-soft); }
.ai-tab{ border:0; background:transparent; color:var(--muted); font-size:13px; padding:6px 10px; border-radius:8px; cursor:pointer; }
.ai-tab.on{ background:var(--card); color:var(--primary-d); font-weight:600; box-shadow:var(--shadow-sm); }
.ai-chat-body{ flex:1; overflow-y:auto; padding:12px; background:var(--bg); }
.ai-chat-body .inp{ width:100%; margin-bottom:8px; }
.ai-chat-body .seg{ margin-bottom:8px; }
.ai-msg{ display:flex; flex-direction:column; margin-bottom:12px; }
.ai-msg.user{ align-items:flex-end; }
.ai-msg.bot{ align-items:flex-start; }
.ai-bubble{ max-width:90%; padding:10px 12px; border-radius:12px; font-size:13.5px; line-height:1.65;
  white-space:pre-wrap; word-break:break-word; }
.ai-msg.user .ai-bubble{ background:var(--primary); color:#fff; border-bottom-right-radius:4px; }
.ai-msg.bot .ai-bubble{ background:var(--card); color:var(--text); border:1px solid var(--line); border-bottom-left-radius:4px; }
.ai-msg.bot .ai-hits{ max-width:100%; margin-top:6px; background:var(--card); }
.ai-egs{ display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.ai-eg{ font-size:12px; color:var(--primary-d); background:var(--primary-soft); border:1px solid var(--primary-ring);
  border-radius:999px; padding:4px 10px; cursor:pointer; }
.ai-eg:hover{ background:var(--primary); color:#fff; }
.ai-tables{ width:100%; margin-top:8px; max-width:100%; }
.ai-table-card{ background:var(--card); border:1px solid var(--line); border-radius:10px; margin-bottom:8px; overflow:hidden; }
.ai-table-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 10px;
  background:var(--primary-soft); font-size:12.5px; font-weight:600; color:var(--text); border-bottom:1px solid var(--line); }
.ai-table-card .tbl{ margin:0; font-size:12px; }
.ai-table-card .tbl th, .ai-table-card .tbl td{ padding:5px 8px; font-size:12px; white-space:nowrap; }
.ai-chat-foot{ display:flex; gap:8px; padding:10px; border-top:1px solid var(--line); background:var(--card); }
.ai-input{ flex:1; resize:none; padding:9px 11px; border:1px solid var(--line); border-radius:10px; font-size:13.5px;
  outline:none; background:var(--primary-soft); font-family:inherit; }
.ai-input:focus{ border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-ring); background:var(--card); }
.ai-chat-foot .btn-primary{ width:auto; padding:0 18px; }
@media (max-width:640px){
  .ai-chat{ right:8px; left:8px; width:auto; bottom:8px; height:72vh; }
  .ai-fab{ left:14px; bottom:18px; }
}

/* 隐藏智能助手悬浮图标(2026-09-02: 需求不再显示浮动球; 助手仍可由侧栏"🤖 智能助手"打开) */
.ai-fab{ display:none !important; }

/* ===== 装柜大师 ===== */
.lo-grid{ display:grid; grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr); gap:18px; align-items:start; }
.lo-card{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:18px; }
.lo-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.lo-row.between{ justify-content:space-between; }
.lo-row .label{ font-weight:600; color:var(--text); font-size:13.5px; }
.lo-row .chk{ display:inline-flex; align-items:center; gap:5px; font-size:13px; color:var(--muted); cursor:pointer; }
.lo-boxes td, .lo-boxes th{ padding:5px 6px; font-size:12.5px; }
.lo-boxes .inp.sm, .lo-boxes .inp.xs{ width:100%; min-width:0; }
.lo-boxes .ctr{ text-align:center; }
.kpi{ display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:14px; }
.kpi-item{ background:var(--primary-soft); border:1px solid var(--line); border-radius:12px; padding:12px 10px; text-align:center; }
.kpi-v{ font-size:21px; font-weight:800; color:var(--primary-d); line-height:1.15; font-variant-numeric:tabular-nums; }
.kpi-l{ font-size:11.5px; color:var(--muted); margin-top:4px; }
.warn-box{ background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; border-radius:10px; padding:9px 12px; font-size:12.5px; margin-bottom:12px; }
.warn-box .warn-item{ display:inline-block; margin-left:6px; }
.lo-diagrams{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px; }
.lo-diag{ background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px; }
.lo-diag-t{ font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:6px; }
.modal-h-actions{ margin-left:auto; display:inline-flex; gap:8px; align-items:center; }
.lo-cont-form{ flex-wrap:wrap; }
.tbl-wrap{ max-height:340px; overflow:auto; border:1px solid var(--line); border-radius:10px; margin:10px 0; }
@media (max-width:900px){
  .lo-grid{ grid-template-columns:1fr; }
  .kpi{ grid-template-columns:repeat(2,1fr); }
  .lo-diagrams{ grid-template-columns:1fr; }
}


/* 装柜大师 3D 内嵌界面 */
.loading-frame{ width:100%; height:calc(100vh - 168px); border:0; border-radius:10px; background:#fff; box-shadow:0 1px 4px rgba(20,30,50,.08); }

/* ==========================================================================
   海外售后服务模块(工单/质保/物流) — v20260831
   仅追加, 不改动任何现有规则
   ========================================================================== */
.drawer.wide{ width:860px; }
.form-row{ display:flex; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.form-row .fl{ font-size:12.5px; color:var(--muted); min-width:96px; }
.inp.ta{ min-height:70px; padding:10px 12px; resize:vertical; font-family:inherit; }
.inp.w80{ width:80px; min-width:80px; }
.inp.w60{ width:60px; min-width:60px; }
th.w80, td.w80{ width:80px; }
th.w60, td.w60{ width:60px; }

/* 售后页签(与后台 .tabs 风格一致, 独立命名避免污染) */
.svc-tabs{ display:inline-flex; gap:4px; padding:4px; background:#eef1f6;
  border:1px solid var(--line); border-radius:11px; }

/* 状态徽标 */
.badge-st, .badge-warr, .badge-charge{
  display:inline-block; padding:3px 9px; border-radius:20px;
  font-size:11.5px; font-weight:600; white-space:nowrap; line-height:1.5;
}
.badge-st.submitted,.badge-st.reviewing{ background:var(--primary-soft); color:var(--primary-d); }
.badge-st.approved{ background:var(--green-soft); color:var(--green-d); }
.badge-st.shipping{ background:#e0f2fe; color:#0369a1; }
.badge-st.closed{ background:#eef1f6; color:#4b5565; }
.badge-st.rejected,.badge-st.cancelled{ background:var(--danger-soft); color:var(--danger); }
.badge-warr.in_warranty{ background:var(--green-soft); color:var(--green-d); }
.badge-warr.out_warranty{ background:var(--amber-soft); color:var(--amber); }
.badge-warr.unknown{ background:#eef1f6; color:var(--muted); }
.badge-charge.warranty{ background:var(--green-soft); color:var(--green-d); }
.badge-charge.paid{ background:var(--amber-soft); color:var(--amber); }

/* 看板卡片 */
.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin:14px 0 18px; }
.stat-card{ background:var(--card); border:1px solid var(--line); border-radius:13px;
  padding:16px 18px; box-shadow:var(--shadow-sm); border-top:3px solid var(--primary); }
.stat-card.ok{ border-top-color:var(--green); }
.stat-card.warn{ border-top-color:var(--amber); }
.stat-num{ font-size:26px; font-weight:700; color:var(--text); line-height:1.2; font-variant-numeric:tabular-nums; }
.stat-lbl{ font-size:12px; color:var(--muted); margin-top:4px; }

.svc-cols{ display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:18px; }
.svc-col{ background:var(--card); border:1px solid var(--line); border-radius:13px;
  padding:14px 16px; box-shadow:var(--shadow-sm); min-width:0; }
.svc-col .sec-title{ margin-top:0; }

@media (max-width:900px){
  .drawer.wide{ width:100%; max-width:100%; }
  .svc-cols{ grid-template-columns:1fr; }
  .form-row .fl{ min-width:100%; }
}

/* ==================== 第二波：库存预警 + 数据报表（追加，不改动上方任何规则） ==================== */

/* --- 库存状态徽标：复用 .badge-st 语义色，补齐 5 种状态 --- */
.badge-st.ok{ background:#e7f6ec; color:#0f7b3f; }
.badge-st.low{ background:#fff4e2; color:#b45309; }
.badge-st.out{ background:#fdecec; color:#b42318; }
.badge-st.dormant{ background:#eef0f3; color:#4b5563; }
.badge-st.unset{ background:#f3f4f6; color:#9ca3af; }

/* --- 变动类型徽标：in 入库(绿) / out 出库(蓝) / check 盘点(灰) --- */
.badge-charge.in{ background:#e7f6ec; color:#0f7b3f; }
.badge-charge.out{ background:#e8f0fb; color:#1a5fb4; }
.badge-charge.check{ background:#eef0f3; color:#4b5563; }
.badge-charge.init{ background:#f3e8ff; color:#6b21a8; }

/* --- 卡片容器（报表用） --- */
.card{ background:var(--card); border:1px solid var(--line); border-radius:13px;
  padding:16px 18px; margin:14px 0; box-shadow:var(--shadow-sm); }
.card-hd{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.card-hd b{ font-size:15px; }
.chart-box{ width:100%; height:300px; }
.drill-tip{ background:#e8f0fb; color:#1a5fb4; padding:3px 10px; border-radius:11px; font-size:12.5px; }

/* --- KPI 数值语义色 --- */
.stat-num.ok{ color:#0f7b3f; }
.stat-num.warn{ color:#b45309; }
.stat-num.danger{ color:#b42318; }
.stat-num.muted{ color:var(--muted); }

/* --- 环比涨跌 --- */
.stat-delta{ font-size:12px; margin-top:3px; color:var(--muted); }
.stat-delta.up{ color:#b42318; }      /* 出口业务增长用红：与国内习惯一致 */
.stat-delta.down{ color:#0f7b3f; }

/* --- 表格紧凑模式与数值右对齐 --- */
.tbl.compact th, .tbl.compact td{ padding:6px 9px; font-size:13px; }
.tbl td.num, .tbl th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.tbl td.empty{ text-align:center; color:var(--muted); padding:26px 0; }
.tbl .suggest{ color:#b45309; }
.tbl .mono.sm{ font-size:12px; }

/* --- 参数设置表单 --- */
.form-box{ background:var(--card); border:1px solid var(--line); border-radius:13px;
  padding:18px 20px; box-shadow:var(--shadow-sm); max-width:520px; }
.form-box .form-row{ margin-bottom:12px; }
.form-box label{ display:inline-block; min-width:150px; font-size:13.5px; color:#374151; }
.form-box .inp.w80{ width:110px; display:inline-block; }

/* --- 导入结果提示 --- */
.import-msg{ margin-top:10px; padding:9px 12px; background:#f0f7ff;
  border-left:3px solid var(--brand); border-radius:0 6px 6px 0; font-size:13px; }
.import-msg.warn{ background:#fff4f4; border-left-color:var(--red); }
.import-detail{ margin-top:8px; padding:9px 12px; background:#fbf2f2; color:#a3343a;
  border:1px solid #f0d3d3; border-radius:6px; font-size:12px; white-space:pre-wrap;
  max-height:180px; overflow:auto; line-height:1.6; }

/* --- 数据报表表格：数据与标题统一左对齐 --- */
#view-report .tbl.compact th,
#view-report .tbl.compact td{ text-align:left; }

/* ==================== 海外仓投放(寄售) 模块样式（追加，不改动上方任何规则） ==================== */

/* 状态徽标：补齐 发放类型 / 低库存 语义色 */
.badge-st.danger{ background:var(--danger-soft); color:var(--danger); }
.badge-st.warranty{ background:var(--green-soft); color:var(--green-d); }
.badge-st.sale{ background:var(--amber-soft); color:var(--amber); }

/* 自动补全下拉 */
.ac-list{ position:absolute; z-index:50; left:0; right:0; top:100%; margin-top:2px;
  background:var(--card); border:1px solid var(--line); border-radius:10px;
  box-shadow:var(--shadow-md); max-height:220px; overflow:auto; padding:4px; }
.ac-item{ padding:8px 10px; border-radius:7px; cursor:pointer; font-size:13px; line-height:1.4; }
.ac-item:hover{ background:var(--primary-soft); color:var(--primary-d); }
label{ position:relative; }   /* 让 .ac-list 相对 label 定位 */

/* 弹窗内零件行 */
.ci-row{ display:flex; align-items:center; gap:10px; padding:7px 10px; margin:6px 0;
  background:var(--primary-soft); border:1px solid var(--line); border-radius:9px; }
.ci-row .mono{ flex:0 0 150px; }
.ci-row .muted{ flex:1; min-width:0; }

@media (max-width:900px){
  .chart-box{ height:240px; }
  .form-box{ max-width:100%; }
  .form-box label{ min-width:110px; }
}

/* v2.5 备件批量导入弹窗: 需压过其它已打开的弹窗/抽屉(如海外仓-新建投放), 提升层级 */
.modal-mask.bulk-top{ z-index:90; }

/* 2026-09-08 零件编码列加宽: 原 110px 放不下 15 字符标准编码(如 30BCT0-3701100A)被省略号截断;
   提宽至 150px, 超长复合编码允许折行完整显示(.mono 已有 word-break:break-all) */
.parts-tbl th:nth-child(1), .parts-tbl td:nth-child(1){ width:150px; white-space:normal; }
