/* 零件库 · 设计令牌（批 4 · 2026-11-28）
   双皮肤与易企干 MES/小录同源：夜航青（深色·内部主用，默认）/ 支付蓝（浅色·对外与强光）
   切换 = body 换类（pal-yehan / pal-payblue），选择存 localStorage('yq-pal')，四系统共键
   注意：var 引用型别名必须在每个皮肤块内重复声明（按声明所在元素上下文解析） */
:root, body.pal-yehan {
  --paper: #060A13; --card: #0D1526; --ink: #E8EEF7;
  --accent: #22D3EE; --accent-hover: #5CE3F7; --accent-press: #0FA8C6;
  --accent-soft: rgba(34,211,238,.12); --accent-glow: rgba(34,211,238,.30);
  --on-accent: #05222B;
  --line: rgba(120,160,215,.14); --line-strong: rgba(120,160,215,.30);
  --text-1: #E8EEF7; --text-2: #9AABBF; --text-3: #5E6E87;
  --ok: #34D399; --warn: #FBBF24; --danger: #F87171;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4);
  --shadow-pop: 0 4px 12px rgba(0,0,0,.5), 0 24px 64px rgba(0,0,0,.55);
  --track: rgba(120,160,215,.16);
  --scrim: rgba(2,5,12,.62);
  --brand-line: rgba(34,211,238,.35);
  --ok-line: rgba(52,211,153,.35);
  --warn-line: rgba(251,191,36,.38);
  --danger-line: rgba(248,113,113,.40);
  --toast-bg: #1E2A3D; --toast-text: #E8EEF7;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* 零件库兼容别名（每皮肤块重复声明） */
  --brand: var(--accent); --brand-2: var(--accent-press);
  --brand-soft: rgba(34,211,238,.10); --brand-weak: rgba(34,211,238,.16);
  --navy: #0A1120; --navy-text: #8B9BB5; --on-navy: #E8EBF2;
  --bg: var(--paper); --text: var(--text-1); --line-2: var(--line-strong);
  --surface-2: rgba(120,160,215,.07); --input-bg: rgba(120,160,215,.07);
  --success: var(--ok); --warning: var(--warn);
  --success-bg: rgba(52,211,153,.13); --success-line: rgba(52,211,153,.35); --success-text: #6EE7B7;
  --warning-bg: rgba(251,191,36,.12); --warning-text: #FCD34D;
  --danger-bg: rgba(248,113,113,.13);
  --tabbar-bg: #0D1526;
  --auth-1: #101A2E; --auth-2: #060A13; --auth-3: #04070E;
  --radius: 10px; --radius-sm: 6px;
  --shadow: var(--shadow-card);
  --shadow-up: 0 6px 16px rgba(0,0,0,.45);
}
body.pal-payblue {
  --paper: #F5F7FA; --card: #FFFFFF; --ink: #17202B;
  --accent: #1268F3; --accent-hover: #3D86F7; --accent-press: #0B53C6;
  --accent-soft: rgba(18,104,243,.10); --accent-glow: rgba(18,104,243,.30);
  --on-accent: #FFFFFF;
  --line: rgba(22,32,43,.10); --line-strong: rgba(22,32,43,.25);
  --text-1: #17202B; --text-2: #55606F; --text-3: #98A2B0;
  --ok: #0E8A3E; --warn: #D97706; --danger: #D92D20;
  --shadow-card: 0 1px 2px rgba(22,32,43,.04), 0 6px 20px rgba(22,32,43,.06);
  --shadow-pop: 0 2px 6px rgba(22,32,43,.10), 0 16px 48px rgba(22,32,43,.16);
  --track: rgba(22,32,43,.10);
  --scrim: rgba(10,15,25,.45);
  --brand-line: rgba(18,104,243,.28);
  --ok-line: rgba(14,138,62,.30);
  --warn-line: rgba(217,119,6,.35);
  --danger-line: rgba(217,45,32,.32);
  --toast-bg: #1D2129; --toast-text: #FFFFFF;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* 零件库兼容别名（每皮肤块重复声明） */
  --brand: var(--accent); --brand-2: var(--accent-press);
  --brand-soft: rgba(18,104,243,.08); --brand-weak: rgba(18,104,243,.14);
  --navy: #082D4F; --navy-text: #A9C2E8; --on-navy: #FFFFFF;
  --bg: var(--paper); --text: var(--text-1); --line-2: var(--line-strong);
  --surface-2: #F4F6FA; --input-bg: #FFFFFF;
  --success: var(--ok); --warning: var(--warn);
  --success-bg: rgba(14,138,62,.10); --success-line: rgba(14,138,62,.30); --success-text: #0E8A3E;
  --warning-bg: rgba(217,119,6,.10); --warning-text: #92400E;
  --danger-bg: rgba(217,45,32,.08);
  --tabbar-bg: #FFFFFF;
  --auth-1: #E8F0FC; --auth-2: #F5F7FA; --auth-3: #DFE8F4;
  --radius: 10px; --radius-sm: 6px;
  --shadow: var(--shadow-card);
  --shadow-up: 0 6px 16px rgba(22,32,43,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; }
::selection { background: var(--accent-soft); }

.boot-loading { padding: 80px; text-align: center; color: var(--text-3); }

/* ---------- 布局 ---------- */
.layout { max-width: 1080px; margin: 0 auto; padding: 0 14px 60px; }

/* 顶栏：深海军蓝，与供应商平台侧栏同色 */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 54px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.topbar .logo { display: flex; align-items: center; gap: 9px; }
.logo-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--brand); color: var(--on-accent); font-size: 15px; font-weight: 800; flex: none; }
.logo-txt { color: var(--on-navy); font-size: 16px; font-weight: 700; letter-spacing: .5px; line-height: 1.15; display: flex; flex-direction: column; }
.logo-sub { font-size: 9.5px; font-weight: 600; color: var(--navy-text); letter-spacing: 1.6px; }
.topbar nav { display: flex; gap: 4px; margin-left: 10px; }
.topbar nav a { padding: 7px 14px; border-radius: 999px; color: var(--navy-text); text-decoration: none; font-weight: 600; font-size: 14px; transition: color .15s, background .15s; }
.topbar nav a:hover { color: var(--on-navy); }
.topbar nav a.on { background: var(--brand); color: var(--on-accent); }
.topbar .btn-mes { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: var(--on-accent); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; text-decoration: none; flex-shrink: 0; }
.topbar .btn-mes:hover { filter: brightness(1.12); }
.topbar .who { display: flex; align-items: center; gap: 8px; color: var(--navy-text); font-size: 13px; }
.topbar .who b { color: var(--on-navy); font-weight: 600; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--on-accent); font-size: 13px; font-weight: 700; flex: none; }
.topbar .who a { color: var(--navy-text) !important; text-decoration: none; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .14); }
.topbar .who a:hover { color: var(--on-navy) !important; }
/* 手机端（批 4）：顶栏只留品牌行，导航改底部标签栏（拍板标准：手机端一律底部标签栏，不再侧拉抽屉/顶部横滑） */
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 14px; height: 50px; }
  .logo-badge { width: 25px; height: 25px; font-size: 13.5px; }
  .logo-txt { font-size: 14.5px; }
  .logo-sub { display: none; }
  .topbar nav, .topbar .who { display: none; }
  .topbar .btn-mes { padding: 5px 12px; font-size: 12px; }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .tbl { min-width: 430px; }
  .tbl.cost { min-width: 0; }
  .tbl .cb, .tbl .cp { display: none; }
}

.page { padding-top: 18px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { font-size: 21px; font-weight: 800; }
.page-head p { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.spacer { flex: 1; }

/* 统计概览条：大数字卡片，与供应商平台 Dashboard 同风格 */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px; }
.stat .num { font-family: var(--mono); font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat .num.brand { color: var(--brand); }
.stat .num.muted { color: var(--text-3); }
.stat .num.sk { color: var(--line-2); font-family: inherit; }
.stat .lbl { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); border-radius: var(--radius-sm); padding: 9px 15px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-accent); box-shadow: 0 2px 6px var(--accent-glow); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--on-accent); }
.btn-danger { color: var(--danger); border-color: var(--danger-line); background: var(--card); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 18px; font-size: 15.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn svg { flex: none; }

/* ---------- 卡片/零件列表 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; color: var(--text-3); transition: border .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; border: 0; outline: none; padding: 10px 0; background: transparent; color: var(--text); }
/* 筛选面板：搜索 + 药丸收进一张白卡，内容区更整体 */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 14px 6px; margin-bottom: 14px; }
.panel .search { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 2px; }
.panel .search:focus-within { border-color: var(--brand); box-shadow: none; }
.panel .chips { margin: 11px 0 6px; }
.panel .chips:last-child { margin-bottom: 8px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-accent); box-shadow: 0 2px 5px var(--accent-glow); }

.part-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 720px) { .part-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 1000px) { .part-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); } }
.part-card { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 14px; cursor: pointer; display: flex; gap: 10px; transition: box-shadow .15s, border-color .15s, transform .15s; }
.part-card:hover { box-shadow: var(--shadow-up); border-color: var(--brand-line); border-left-color: var(--brand); transform: translateY(-1px); }
.part-card.disabled { border-left-color: var(--text-3); opacity: .72; }
.part-card.merged { border-left-color: var(--warning); opacity: .72; }
.part-thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.part-thumb-none { width: 52px; height: 52px; border-radius: 8px; flex: none; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; color: var(--brand); }
.part-main { flex: 1; min-width: 0; }
.part-code { font-family: var(--mono); font-weight: 700; font-size: 13.5px; color: var(--brand); letter-spacing: .2px; }
.part-name { font-size: 15px; font-weight: 700; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.part-name .pn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-name .tag { flex: none; margin-left: 0; }
.part-sub { color: var(--text-3); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 7px; margin-left: 6px; vertical-align: 1px; }
.tag.cat { background: var(--brand-soft); color: var(--brand); }
.tag.dis { background: var(--track); color: var(--text-3); }
.tag.merged { background: var(--warning-bg); color: var(--warning); }

.empty { text-align: center; color: var(--text-3); padding: 46px 20px; }
/* 空状态卡片：图标 + 标题 + 引导按钮 */
.empty-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; padding: 52px 20px 46px; }
.empty-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.empty-icon svg { width: 28px; height: 28px; }
.empty-title { font-size: 16px; font-weight: 800; }
.empty-sub { color: var(--text-3); font-size: 13px; margin: 7px 0 18px; }
.more-wrap { text-align: center; margin: 14px 0; }

/* ---------- 表单：标签在上输入在下，宽屏两列 ---------- */
.fields { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px 14px; }
@media (min-width: 720px) { .fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 22px 20px; gap: 16px; } }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--input-bg); color: var(--text); font-weight: 500; text-align: left; outline: none; transition: border .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { min-height: 76px; resize: vertical; }
.field .req { color: var(--danger); }
.field .ro { font-family: var(--mono); font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.form-actions { display: flex; gap: 9px; margin-top: 14px; }
.img-pick { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.img-pick img { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }

/* ---------- 详情 ---------- */
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; }
.hero .code { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--brand); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.hero .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 10px; margin-top: 14px; }
.hero .cell .k { font-size: 12px; color: var(--text-3); }
.hero .cell .v { font-weight: 700; margin-top: 2px; word-break: break-all; }
/* v2.5.0 详情页重构：左照片右信息，宽屏不再偏出留白；窄屏自动竖排 */
.hero-flex { display: flex; gap: 18px; align-items: flex-start; }
.hero-side { flex: 1; min-width: 0; }
.hero img.big { width: 400px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-2); margin-top: 0; flex: none; cursor: zoom-in; }
.hero .big-none { width: 400px; max-width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--line-2); flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); font-size: 13px; }
@media (max-width: 719px) { .hero-flex { flex-direction: column; } .hero img.big, .hero .big-none { width: 100%; } }
.sec { font-size: 15px; font-weight: 800; margin: 18px 2px 9px; padding-left: 9px; border-left: 3px solid var(--brand); }
.sec .n { color: var(--text-3); font-weight: 600; font-size: 12.5px; }

/* ---------- 审计 ---------- */
.audit-row { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 11px 13px; margin-bottom: 9px; }
.audit-row .top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.audit-row .actor { font-weight: 800; }
.audit-row .act { color: var(--brand); font-weight: 700; }
.audit-row .time { margin-left: auto; color: var(--text-3); font-size: 12px; font-family: var(--mono); }
.audit-row .chg { color: var(--text-2); font-size: 13px; margin-top: 5px; line-height: 1.7; }
.audit-row .chg b { color: var(--text); }
.audit-row .chg .from { color: var(--text-3); text-decoration: line-through; }
.audit-row .note { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }

/* ---------- 登录/初始化：深色底 + 白卡，与供应商平台登录页一致 ---------- */
.auth-page { min-height: 100vh; background: linear-gradient(160deg, var(--auth-1) 0%, var(--auth-2) 60%, var(--auth-3) 100%); display: flex; align-items: flex-start; justify-content: center; }
.auth-wrap { width: 100%; max-width: 400px; margin: 9vh auto 0; padding: 0 16px; }
.auth-card { background: var(--card); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); padding: 30px 26px 26px; }
.auth-badge { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 10px; background: var(--brand); color: var(--on-accent); font-size: 23px; font-weight: 800; box-shadow: 0 4px 12px var(--accent-glow); }
.auth-card h1 { font-size: 20px; text-align: center; font-weight: 700; }
.auth-card .sub { text-align: center; color: var(--text-3); font-size: 13px; margin: 7px 0 22px; line-height: 1.6; }
.auth-card input { width: 100%; background: var(--input-bg); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 13px; margin-bottom: 12px; outline: none; transition: border .15s, box-shadow .15s; }
.auth-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 弹窗/toast ---------- */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--toast-bg); color: var(--toast-text); border-radius: 8px; padding: 11px 15px; font-size: 14px; text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); animation: tin .18s ease-out; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.mask { position: fixed; inset: 0; background: var(--scrim); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sheet { background: var(--card); border-radius: 14px; width: 100%; max-width: 460px; max-height: 82vh; overflow: auto; padding: 18px 18px 22px; box-shadow: var(--shadow-pop); animation: sheet-in .18s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: scale(.96); } }
.sheet h3 { font-size: 16.5px; margin-bottom: 10px; }
.sheet .desc { color: var(--text-2); font-size: 13.5px; line-height: 1.7; margin-bottom: 12px; }
.sheet input, .sheet select { width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 10px; outline: none; transition: border .15s, box-shadow .15s; }
.sheet input:focus, .sheet select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
.sheet .ops { display: flex; gap: 9px; margin-top: 6px; }
.dup-item { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; font-size: 13.5px; }
.dup-item b { font-family: var(--mono); color: var(--brand); }
.dup-item .s { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }

/* ---------- 设置 ---------- */
.set-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.set-card h3 { font-size: 15px; margin-bottom: 10px; padding-left: 9px; border-left: 3px solid var(--brand); }
.set-card .row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.set-card .row:last-child { border-bottom: 0; }
.set-card .row .main { flex: 1; min-width: 0; }
.set-card .row .main .t { font-weight: 700; }
.set-card .row .main .s { color: var(--text-3); font-size: 12.5px; margin-top: 2px; word-break: break-all; }
.hint { color: var(--text-3); font-size: 12.5px; line-height: 1.7; margin-top: 8px; }
.key-once { background: var(--success-bg); border: 1px solid var(--success-line); color: var(--success-text); border-radius: 8px; padding: 11px 13px; font-size: 13px; word-break: break-all; margin-top: 10px; font-family: var(--mono); }

/* ---------- 一期扩展：BOM / 库存 / 成本 / 订单 / 采购 ---------- */
.slbl { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin: 2px 0 6px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); margin: 2px 0 12px; cursor: pointer; }
.sheet .checkline input[type="checkbox"] { width: auto; margin: 0; }
.pickline { display: flex; gap: 8px; align-items: stretch; }
.pickline .pick-val { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--input-bg); font-weight: 600; display: flex; align-items: center; }
.pickline .pick-val .ph { color: var(--text-3); font-weight: 500; }
.bom-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bom-row:last-child { border-bottom: 0; }
.bom-row .bm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-row .bm b { font-family: var(--mono); color: var(--brand); margin-right: 6px; }
.bom-row input { width: 86px; flex: none; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.tbl th { text-align: left; color: var(--text-3); font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-family: var(--mono); white-space: nowrap; }
.tag.warn { background: var(--warning-bg); color: var(--warning); }
.warn-card { background: var(--warning-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 14px; font-size: 13.5px; color: var(--warning-text); line-height: 1.8; }
.order-card { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 14px; margin-bottom: 10px; }
.order-card.closed { border-left-color: var(--text-3); opacity: .75; }
.order-card .o-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.order-card .o-code { font-family: var(--mono); font-weight: 700; color: var(--brand); }
.order-card .o-name { font-weight: 700; }
.order-card .o-nums { display: flex; gap: 22px; margin-top: 9px; flex-wrap: wrap; }
.order-card .o-num .k { font-size: 12px; color: var(--text-3); }
.order-card .o-num .v { font-family: var(--mono); font-weight: 800; font-size: 17px; }
.order-card .o-num .v.brand { color: var(--brand); }
.order-card .o-meta { color: var(--text-3); font-size: 12.5px; margin-top: 8px; }
.order-card .o-ops { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.back { display: inline-flex; align-items: center; gap: 5px; color: var(--brand); background: none; border: 0; font-size: 14.5px; font-weight: 600; cursor: pointer; padding: 4px 0; margin-bottom: 10px; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); z-index: 90; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

/* v1.2 差距修复：参数缺失提示条（详情页）/ 超发负余量红字 */
.warn-banner { background: var(--warning-bg); border: 1px solid var(--warn-line); border-left: 4px solid var(--warn); border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 13px; line-height: 1.7; color: var(--warning-text); }
.o-num .v.neg { color: var(--danger); }

/* v2.0 二期：合计行 / 成本树缩进 */
.proc-total td { background: var(--surface-2); border-top: 2px solid var(--line-2); }
.cost-sub td { background: var(--surface-2); }
.cost-branch { display: inline-block; width: 7px; height: 9px; border-left: 2px solid var(--line-2); border-bottom: 2px solid var(--line-2); margin: 0 6px 2px 2px; vertical-align: middle; }
input[type="date"] { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-family: inherit; font-size: 13.5px; background: var(--input-bg); color: var(--text-1); }
input[type="date"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }

/* v2.2.1 版本自检：顶栏版本号 + 旧版提示条 */
.topbar .who .ver-tag { font-family: var(--mono); font-size: 11px; color: var(--navy-text); opacity: .85; }
.stale-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: var(--warning-bg); border-bottom: 1px solid var(--warn-line); color: var(--warning-text); text-align: center; font-size: 14px; font-weight: 600; padding: 10px 16px; cursor: pointer; }
.stale-bar:hover { background: var(--warn-line); }

/* v2.3.0 记录卡操作痕迹小字 */
.card-log { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 批 4：底部标签栏（仅手机端） ---------- */
.tabbar { display: none; }
@media (max-width: 640px) {
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--tabbar-bg); border-top: 1px solid var(--line); height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); text-decoration: none; font-size: 10.5px; font-weight: 600; min-height: 44px; }
  .tabbar a.on { color: var(--brand); }
  .tabbar a svg { width: 22px; height: 22px; display: block; }
}

/* ---------- 批 4：皮肤切换器（与 MES/小录同款） ---------- */
.pal-row { display: flex; gap: 10px; }
.pal-opt { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-family: inherit; text-align: left; }
.pal-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.pal-dot { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.pal-dot.yehan { background: linear-gradient(135deg, #060A13 52%, #22D3EE 52%); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.pal-dot.payblue { background: linear-gradient(135deg, #FFFFFF 52%, #1268F3 52%); box-shadow: inset 0 0 0 1.5px rgba(22,32,43,.22); }
.pal-opt b { font-size: 13px; color: var(--text); display: block; }
.pal-opt small { font-size: 11px; color: var(--text-3); display: block; margin-top: 1px; }
.pal-opt .pal-check { margin-left: auto; color: var(--brand); visibility: hidden; flex: none; display: flex; }
.pal-opt.on .pal-check { visibility: visible; }

/* ---------- 批 4：iOS 专项 ---------- */
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; } /* 防 iOS 聚焦自动放大 */
}
