/* CNC 管理系统 - 样式
 * 风格对齐视频：深色侧边栏 + 白色内容区 + 蓝色主色 + 绿色强调
 * 字体：中文走系统黑体；数字/拉丁/符号走内嵌 JetBrains Mono（OFL 开源，离线可用），
 *       用于 KPI、工时、数量、甘特时间等数据，塑造工业仪表盘质感。
 */

/* —— 内嵌等宽字体（数字/拉丁专用，local() 优先命中本机，未命中走内嵌 woff2）—— */
@font-face {
  font-family: 'JetBrains Mono';
  src: local('JetBrains Mono'), local('JetBrainsMono'),
       url('../vendor/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: local('JetBrains Mono Medium'), local('JetBrainsMono-Medium'),
       url('../vendor/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: local('JetBrains Mono SemiBold'), local('JetBrainsMono-SemiBold'),
       url('../vendor/fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: local('JetBrains Mono Bold'), local('JetBrainsMono-Bold'),
       url('../vendor/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --sidebar: #111827;
  --sidebar-hover: #1f2937;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  /* 字体令牌：--font-sans 中文正文；--font-num 数据/数字专用等宽字 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.6;
}
.hidden { display: none !important; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px;
  background:var(--surface); color: var(--text); font-weight: 500; transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 3px 9px; font-size: 12px; }
.icon-btn {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
  background:var(--surface); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.icon-btn svg.ico { width: 16px; height: 16px; display: block; flex: none; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; position: relative; display: flex; align-items: center; justify-content: flex-end; padding-right: 12%; overflow: hidden; }
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 65% 30%, rgba(34,197,94,.22), transparent 40%),
    radial-gradient(circle at 20% 70%, rgba(37,99,235,.25), transparent 45%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
}
.login-bg::after {
  content: ''; position: absolute; inset: 0; opacity: .12;
  background-image: linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: 42px 42px;
}
.login-box {
  position: relative; z-index: 1; width: 360px; padding: 30px 28px; border-radius: 14px;
  background: rgba(255,255,255,.92); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; background: var(--success-light); color: var(--success); font-size: 12px; }
.login-title { font-size: 30px; margin: 14px 0 2px; color: #0f172a; }
.login-subtitle { font-size: 25px; color: var(--success); margin-bottom: 10px; text-shadow: 0 0 12px rgba(34,197,94,.35); }
.login-desc { color: var(--text-muted); font-size: 12px; margin-bottom: 20px; line-height: 1.8; }
.login-box label { display: block; font-size: 12px; color: var(--text-muted); margin: 12px 0 5px; }
.login-box input[type=text], .login-box input[type=password] {
  width: 100%; padding: 10px 12px; border: 1px solid #22c55e; border-radius: 6px; outline: none;
}
.login-box input[type=password] { border-color: var(--border); }
.check-line { display: flex !important; align-items: center; gap: 6px; font-size: 12px !important; color: var(--text) !important; margin: 14px 0 !important; }
.login-box .btn { margin-top: 6px; }
.login-footer { position: absolute; bottom: 26px; left: 8%; display: flex; gap: 40px; z-index: 1; color: #fff; }
.login-footer div { display: flex; flex-direction: column; align-items: center; }
.login-footer b { font-size: 22px; }
.login-footer span { font-size: 11px; color: rgba(255,255,255,.6); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 216px; flex-shrink: 0; background: var(--sidebar); color: #d1d5db; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; overflow: hidden; flex: none; cursor: pointer; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-logo { display: block; max-width: 120px; max-height: 64px; object-fit: contain; margin: 0 auto 10px; }
.login-logo.hidden { display: none; }
.brand-info { display: flex; flex-direction: column; min-width: 0; }
.brand-info b { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-info span { font-size: 11px; color: #9ca3af; }
.sync-bar { display: flex; align-items: center; gap: 8px; margin: 10px 12px 2px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.06); color: #cbd5e1; font-size: 11px; cursor: pointer; user-select: none; transition: background .15s; }
.sync-bar:hover { background: rgba(255,255,255,.12); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; flex: none; }
.sync-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.sync-dot.error { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.sync-ver { margin-left: auto; color: #6b7280; font-size: 10px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-group { padding: 12px 18px 5px; font-size: 11px; color: #6b7280; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px; cursor: pointer;
  font-size: 13px; border-left: 3px solid transparent; transition: .15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-hover); color: #fff; border-left-color: var(--primary); }
.nav-icon { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; opacity: .9; }
.nav-icon svg.ico { width: 16px; height: 16px; display: block; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 9px; }
.quota-bar { display: flex; align-items: center; justify-content: space-between; margin: 10px 12px 0; padding: 8px 10px; border-radius: 8px; background: linear-gradient(90deg, rgba(59,130,246,.22), rgba(59,130,246,.06)); border: 1px solid rgba(59,130,246,.25); color: #dbeafe; font-size: 11px; cursor: pointer; user-select: none; transition: background .15s; }
.quota-bar:hover { background: linear-gradient(90deg, rgba(59,130,246,.32), rgba(59,130,246,.12)); }
.quota-label { opacity: .9; }
.quota-num b { color: #fff; font-size: 13px; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.update-tip { font-size: 11px; color: #cbd5e1; margin-bottom: 10px; line-height: 1.5; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); border-radius: 8px; padding: 9px 10px; }
.update-tip-head { color: #fecaca; font-weight: 600; }
.update-tip-head b { color: #fff; }
.update-tip .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ef4444; margin-right: 5px; }
.update-tip-desc { color: #9ca3af; margin: 4px 0 8px; }
.update-tip-actions { display: flex; gap: 6px; }
.update-tip-actions button { flex: 1; padding: 5px 4px; font-size: 11px; border-radius: 5px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #e5e7eb; cursor: pointer; }
.update-tip-actions button:hover { background: rgba(255,255,255,.14); }
.btn-logout { width: 100%; padding: 7px; background: transparent; border: 1px solid rgba(255,255,255,.15); color: #9ca3af; border-radius: 6px; font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background:var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.crumb { font-size: 15px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.page { padding: 22px 24px 40px; flex: 1; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.bold { font-weight: 600; }
.mt { margin-top: 14px; }
.ml { margin-left: 8px; }
.mb { margin-bottom: 14px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

.stat-card { background:var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; color: var(--text-muted); }
.stat-card .value { font-size: 26px; font-weight: 700; margin: 4px 0; }
.stat-card .sub { font-size: 11px; color: var(--text-muted); }
.stat-card.blue .value { color: var(--primary); }
.stat-card.green .value { color: var(--success); }
.stat-card.orange .value { color: var(--warning); }
.stat-card.red .value { color: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; background: #f9fafb; color: var(--text-muted); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: #b45309; }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-gray { background: #f3f4f6; color: var(--text-muted); }

.progress { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; min-width: 80px; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; }
.progress-bar.green { background: var(--success); }

.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; outline: none; background:var(--surface);
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item textarea { resize: vertical; min-height: 70px; }
.checkbox-line { display: flex; align-items: center; gap: 6px; font-size: 13px; }
/* 修复：.form-item label(display:block) 优先级高于 .checkbox-line，导致复选框与文字分行错位 */
.form-item label.checkbox-line { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 0; cursor: pointer; }
/* 修复：表单全宽规则误伤复选框/单选框，导致选框被拉伸变形 */
.form-item input[type="checkbox"], .form-item input[type="radio"], .checkbox-line input[type="checkbox"] { width: auto; padding: 0; margin: 0; accent-color: var(--primary); flex-shrink: 0; }

/* 上手清单 */
.checklist { display: flex; flex-direction: column; gap: 9px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.check-item:hover { border-color: var(--primary); }
.check-item.done { background: var(--success-light); border-color: #bbf7d0; }
.check-box { width: 18px; height: 18px; border: 1px solid #d1d5db; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.check-item.done .check-box { background: var(--success); border-color: var(--success); color: #fff; }

/* 甘特图 */
.gantt { display: grid; grid-template-columns: 160px repeat(7, 1fr); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background:var(--surface); }
.gantt-cell { padding: 8px 10px; border-right: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; font-size: 12px; min-height: 44px; }
.gantt-cell.head { background: #f9fafb; font-weight: 500; color: var(--text-muted); text-align: center; }
.gantt-cell.machine { background: #fafbfc; font-weight: 500; }
.gantt-bar { position: relative; background: var(--primary); color: #fff; border-radius: 5px; padding: 5px 8px 7px; margin-bottom: 4px; min-height: 30px; cursor: grab; overflow: hidden; }
.gantt-bar:active { cursor: grabbing; }
.gantt-bar.green { background: var(--success); }
.gantt-bar.orange { background: var(--warning); }
.gantt-bar-title { position: relative; z-index: 2; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-bar-time { position: relative; z-index: 2; font-size: 10px; opacity: .9; line-height: 1.3; margin-top: 1px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.gantt-bar-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.85); border-radius: 0 3px 3px 0; z-index: 3; transition: width .3s ease; }
.gantt-cap-bar { height: 4px; background: #e5e7eb; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.gantt-cap-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s ease; }
.gantt-cap-fill.full { background: var(--danger, #dc2626); }

/* 工序卡片 */
.op-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.op-card:hover { border-color: var(--primary); }
.op-seq { width: 46px; height: 46px; border-radius: 8px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.op-info { flex: 1; min-width: 0; }
.op-name { font-weight: 600; }
.op-meta { font-size: 12px; color: var(--text-muted); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background:var(--surface); border-radius: 12px; width: 560px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal.wide { width: 860px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 授权与备份 */
.login-license-tip { margin: 10px 0 4px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-muted); }
.login-error { margin: 10px 0 0; padding: 8px 10px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; font-size: 12px; color: #b91c1c; }
.login-links { display: flex; justify-content: flex-end; margin: 8px 0 0; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; padding: 2px 0; }
.link-btn:hover { text-decoration: underline; }
.notice-info { padding: 10px 12px; background: #eff6ff; border-left: 3px solid var(--primary); border-radius: 4px; font-size: 12px; color: #1e40af; line-height: 1.7; }
.notice-warn { padding: 10px 12px; background: #fffbeb; border-left: 3px solid #f59e0b; border-radius: 4px; font-size: 12px; color: #92400e; line-height: 1.7; }
.notice-ok { padding: 10px 12px; background: #ecfdf5; border-left: 3px solid #16a34a; border-radius: 4px; font-size: 12px; color: #166534; line-height: 1.7; }
.lg-fields { padding: 4px 0 2px; }

/* Toast */
.toast { position: fixed; top: 120px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 20px; border-radius: 8px; z-index: 9500; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* 移动端报工 */
.mobile-page { min-height: 100vh; background: var(--bg); padding-bottom: 40px; }
.mobile-head { background: var(--primary); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 10px; }
.mobile-head h2 { font-size: 17px; font-weight: 600; }
.mobile-body { padding: 14px; max-width: 640px; margin: 0 auto; }
.mobile-card { background:var(--surface); border-radius: 10px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.qr-box { width: 120px; height: 120px; background:var(--surface); border: 2px dashed var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 40px; margin: 10px auto; }

/* 单据预览 */
.document { background:var(--surface); padding: 32px 40px; border: 1px solid var(--border); font-size: 13px; }
.document h1 { text-align: center; font-size: 20px; margin-bottom: 20px; }
.doc-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }

/* 视频补全：甘特时间刻度 / 班次周视图 / 图表 */
.gantt-hours { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); margin-top: 3px; padding: 0 2px; }
.gantt-cell.machine button { margin-top: 4px; }
.shift-grid { display: grid; grid-template-columns: 90px repeat(7, 1fr); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.shift-cell { padding: 6px; border-right: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; font-size: 11px; text-align: center; min-height: 34px; }
.shift-cell.head { background: #f9fafb; font-weight: 600; color: var(--text-muted); }
.shift-block { display: inline-block; color: #fff; border-radius: 3px; padding: 2px 4px; font-size: 10px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 10px 4px 0; border-bottom: 1px solid var(--border); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.bar-col .bar { width: 70%; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-col span { font-size: 10px; color: var(--text-muted); }
.target-ring { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.target-ring > div { width: 64px; height: 64px; border-radius: 50%; background:var(--surface); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: var(--primary); }

/* 老板看板：问候与区域分布 */
.board-greet { margin-bottom: 16px; padding: 12px 14px; background: linear-gradient(90deg, var(--primary-light), #fff); border-radius: 8px; border: 1px solid var(--border); }
.greet-main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.greet-main b { font-size: 17px; }
.greet-tip { margin-top: 8px; font-size: 12px; color: var(--success); background: rgba(34,197,94,.1); display: inline-block; padding: 5px 10px; border-radius: 6px; }
.region-row { display: flex; align-items: center; gap: 4px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.region-row > span { min-width: 64px; }

/* 订单漏斗视图 */
.funnel-card { border: 1px solid var(--border); border-radius: var(--radius); background:var(--surface); padding: 14px 18px; margin-bottom: 16px; }
.funnel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.funnel-row { display: flex; align-items: flex-end; gap: 18px; }
.funnel-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.funnel-bar { width: 44px; border-radius: 5px 5px 0 0; transition: height .3s; }
.funnel-bar.blue { background: #3b82f6; }
.funnel-bar.orange { background: #f59e0b; }
.funnel-bar.green { background: #22c55e; }
.funnel-bar.purple { background: #8b5cf6; }
.funnel-bar.red { background: #ef4444; }
.funnel-num { font-size: 18px; font-weight: 700; margin-top: 4px; font-family: var(--font-num); }
.funnel-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 意见反馈 / 常见问题 */
.faq-list details { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; padding: 8px 12px; background:var(--surface); }
.faq-list summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); outline: none; }
.faq-list details p { margin: 8px 0 2px; line-height: 1.6; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .brand-info, .nav-item span:not(.nav-icon), .nav-group, .update-tip, .btn-logout, .quota-bar { display: none; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .login-page { padding-right: 5%; }
}

/* ---------- 共享文件 / 悬停预览 ---------- */
.file-peek { position: fixed; z-index: 9999; width: 320px; max-height: 420px; overflow: auto; background:var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.18); padding: 10px; pointer-events: none; }
.file-peek .peek-img { width: 100%; max-height: 280px; object-fit: contain; display: block; border-radius: 6px; background: #f6f7f9; }
.file-peek .peek-pdf { width: 100%; height: 300px; border: 0; border-radius: 6px; }
.file-peek .peek-head { font-weight: 700; font-size: 13px; word-break: break-all; margin-bottom: 6px; }
.file-peek .peek-meta { font-size: 11px; color: var(--text-muted); line-height: 1.7; }
.file-peek .peek-kind { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.peek-kind.image { background: #22c55e; } .peek-kind.pdf { background: #ef4444; }
.peek-kind.cad { background: #3b82f6; } .peek-kind.program { background: #8b5cf6; } .peek-kind.file { background: #64748b; }
.peek-file-icon { width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 800; letter-spacing: 1px; background: linear-gradient(135deg,#eef2ff,#e0f2fe); color: #2563eb; border-radius: 8px; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 7px; background:var(--surface); }
.file-item:hover { border-color: var(--primary); background:var(--surface-2); }
.file-item .fi-icon { width: 38px; height: 38px; flex: none; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; }
.fi-icon.image { background: #22c55e; } .fi-icon.pdf { background: #ef4444; }
.fi-icon.cad { background: #3b82f6; } .fi-icon.program { background: #8b5cf6; } .fi-icon.file { background: #64748b; }
.file-item .fi-main { min-width: 0; flex: 1; }
.file-item .fi-name { font-size: 13px; font-weight: 600; word-break: break-all; }
.file-item .fi-sub { font-size: 11px; color: var(--text-muted); }
.folder-card { border: 1px solid var(--border); border-radius: var(--radius); background:var(--surface); margin-bottom: 16px; }
.folder-card .fc-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.folder-card .fc-title { font-weight: 700; font-size: 15px; }
.folder-card .fc-body { padding: 12px 16px; }
.draw-item { transition: border-color .15s, background .15s; }
.draw-item:hover { border-color: var(--primary); background:var(--surface-2); }

/* ---------- 服务端版本残留提示 ---------- */
.server-outdated-banner { position: fixed; z-index: 9998; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: 90vw; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 8px; background: #fff7ed; border: 1px solid #fb923c; color: #9a3412; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: 13px; }
.server-outdated-banner .btn { margin-left: 6px; }

/* ==========================================================================
   车间管理系统 — 工业专业主题「深蓝石墨 / Graphite Steel」
   设计令牌：钢蓝单一强调色 · 石墨冷灰基底 · 琥珀警示 · tabular 数据
   仅覆盖视觉，不改任何业务 DOM / 交互结构
   ========================================================================== */
:root {
  /* 主色：海军藏青（更深、更沉稳的工业蓝） */
  --primary: #0a3d6b;
  --primary-rgb: 10,61,107;
  --primary-dark: #062b4c;
  --primary-light: #e8f0f7;
  --primary-ink: #062a47;
  /* 语义色：降低饱和度，车间强光下更耐看 */
  --success: #3f8762;
  --success-light: #eaf5ef;
  --warning: #c0802e;
  --warning-light: #fdf5e7;
  --danger: #b85450;
  --danger-light: #fbeceb;
  /* 石墨冷灰中性阶 */
  --ink: #16202b;
  --ink-2: #2d3a47;
  --muted: #6b7885;
  --faint: #98a4ae;
  --line: #e2e8ed;
  --line-soft: #eef2f5;
  --surface: #ffffff;
  --surface-2: #f4f7f9;
  --canvas: #edf1f4;
  --graphite: #0f2740;
  --graphite-2: #17395c;
  --graphite-3: #214868;
  --accent: #0e8a9a;
  --accent-rgb: 14,138,154;
  --ink-rgb: 22,32,43;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(var(--ink-rgb),.05), 0 1px 3px rgba(var(--ink-rgb),.04);
  --shadow-2: 0 4px 14px rgba(var(--ink-rgb),.08);
  --shadow-3: 0 18px 48px rgba(10,17,24,.22);
  --ease: cubic-bezier(.16,1,.3,1);
}

/* ---------- 登录页：非对称石墨工业界面 ---------- */
body { font-variant-numeric: tabular-nums; }
.login-page { background: var(--graphite); padding-right: clamp(24px, 11vw, 200px); }
.login-bg {
  background:
    radial-gradient(ellipse 60% 55% at 78% 18%, rgba(var(--primary-rgb),.28), transparent 70%),
    radial-gradient(ellipse 45% 40% at 12% 85%, rgba(var(--accent-rgb),.14), transparent 72%),
    linear-gradient(155deg, var(--graphite) 0%, var(--graphite-2) 52%, var(--graphite) 100%);
}
.login-bg::after {
  opacity: .5;
  background-image:
    linear-gradient(rgba(148,164,174,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,164,174,.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 88%);
  mask-image: linear-gradient(90deg, #000, transparent 88%);
}
/* 左侧工业标语：用伪元素承载，不动 DOM */
.login-page::before {
  content: '精工 · 智造 · 协同'; position: absolute; z-index: 1; left: clamp(28px,7vw,110px); top: 50%;
  transform: translateY(-50%); writing-mode: vertical-rl; letter-spacing: .55em;
  font-size: 15px; font-weight: 600; color: rgba(203,213,225,.38);
}
.login-page::after {
  content: ''; position: absolute; z-index: 0; left: clamp(24px,6vw,96px); top: 22%;
  width: 3px; height: 56%; background: linear-gradient(180deg, transparent, var(--primary), var(--accent), transparent);
  opacity: .6;
}
.login-box {
  width: 384px; padding: 34px 32px 28px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(247,250,252,.94));
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  animation: login-in .7s var(--ease) both;
}
@keyframes login-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.login-badge { background: var(--primary-light); color: var(--primary-ink); font-weight: 700; letter-spacing: .04em; border: 1px solid rgba(var(--primary-rgb),.16); }
.login-title { font-size: 28px; letter-spacing: -.02em; color: var(--ink); margin-top: 16px; }
.login-subtitle { font-size: 14px; color: var(--primary); letter-spacing: .04em; text-shadow: none; font-weight: 600; margin-bottom: 14px; }
.login-desc { line-height: 1.9; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.login-box label { font-weight: 600; color: var(--ink-2); margin-top: 13px; }
.login-box input[type=text], .login-box input[type=password] {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background:var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.login-box input[type=password] { border-color: var(--line); }
.login-box input:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.14); outline: none; }
.login-box .btn-primary { padding: 12px; border-radius: 9px; font-weight: 700; letter-spacing: .08em; margin-top: 10px; box-shadow: 0 6px 16px rgba(var(--primary-rgb),.28); }
.login-license-tip { background: var(--surface-2); }
.login-footer { left: clamp(28px,7vw,110px); bottom: 34px; gap: 34px; }
.login-footer div { align-items: flex-start; }
.login-footer b { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.login-footer span { font-size: 11px; letter-spacing: .1em; }

/* ---------- 主框架：石墨侧边栏 / 顶栏 / 画布 ---------- */
:root {
  --sidebar: #0f2740; --sidebar-hover: #17395c;
  --text: var(--ink); --text-muted: var(--muted);
  --border: var(--line); --bg: var(--canvas); --card: var(--surface);
  --shadow: var(--shadow-1);
}
body { background: var(--canvas); }
.sidebar {
  background: var(--sidebar-bg, #16202A);
  border-right: 1px solid rgba(255,255,255,.05); width: 232px;
}
.brand { padding: 20px 18px; }
.brand-logo { border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 4px 12px rgba(var(--primary-rgb),.4); }
.brand-info b { font-size: 14px; letter-spacing: .01em; }
.brand-info span { color: var(--accent); font-weight: 600; }
.sync-bar, .quota-bar { border: 1px solid rgba(255,255,255,.07); }
.nav-group { color: #64748b; font-weight: 700; text-transform: uppercase; }
.nav-item { border-left-width: 3px; border-radius: 0 7px 7px 0; margin: 1px 8px 1px 0; color: #aab6c2; transition: background .18s, color .18s; }
.nav-item:hover { background: var(--sidebar-hover-bg, rgba(255,255,255,.06)); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(var(--primary-rgb),.32), rgba(var(--primary-rgb),.06)); color: #fff; border-left-color: #5b9ccc; font-weight: 600; }
.nav-icon { color: var(--accent); opacity: .95; }
.nav-badge { background: var(--danger); box-shadow: 0 2px 6px rgba(184,84,80,.4); }
.topbar { box-shadow: var(--shadow-1); padding: 0 28px; }
.crumb { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.avatar { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 3px 8px rgba(var(--primary-rgb),.3); }
.icon-btn { border-radius: 8px; transition: .18s; }
.icon-btn:hover { background: var(--primary-light); }
.page { padding: 24px 28px 44px; }

/* ---------- 页头统一：所有页面标题区采用一致的页头结构 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; margin: 0 0 4px; }
.page-head .muted { line-height: 1.5; }
.page-head .btn { flex: none; }

/* ---------- 卡片 / 表格 / 标签：数据密度与层级 ---------- */
.card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-head { padding: 15px 20px; }
.card-head h3 { font-size: 15px; font-weight: 700; color: var(--ink); }
.card-body { padding: 20px; }
.stat-card { padding: 18px 20px; border-radius: var(--radius); box-shadow: var(--shadow-1); position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.stat-card.orange::before { background: var(--warning); } .stat-card.green::before { background: var(--success); } .stat-card.red::before { background: var(--danger); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stat-card .label { font-weight: 600; letter-spacing: .03em; }
.stat-card .value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.stat-card .sub { color: var(--faint); }
table th { background: var(--surface-2); color: var(--ink-2); font-weight: 700; letter-spacing: .02em; padding: 11px 13px; }
table td { border-bottom-color: var(--line-soft); color: var(--ink-2); }
tr:hover td { background: var(--primary-light); }
.tag { border-radius: 6px; font-weight: 600; padding: 3px 10px; }
.progress { background: var(--line); } .progress-bar { background: var(--primary); } .progress-bar.green { background: var(--success); }

/* ---------- 按钮：触感反馈与层级 ---------- */
.btn { border-radius: 8px; font-weight: 600; transition: transform .16s var(--ease), background .16s, border-color .16s, box-shadow .16s; }
.btn:active { transform: scale(.97); }
.btn-primary { box-shadow: 0 2px 8px rgba(var(--primary-rgb),.22); }
.btn-primary:hover { box-shadow: 0 5px 14px rgba(var(--primary-rgb),.3); }
.btn-sm, .btn-xs { border-radius: 6px; }
.form-item input, .form-item select, .form-item textarea { border-radius: 8px; padding: 9px 11px; transition: border-color .18s, box-shadow .18s; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.12); }

/* ---------- 数据可视化：甘特 / 漏斗 / 图表 ---------- */
.gantt { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.gantt-cell.head, .shift-cell.head { background: var(--surface-2); color: var(--ink-2); font-weight: 700; }
.gantt-cell.machine { background: var(--surface-2); color: var(--ink); }
.gantt-bar { border-radius: 6px; box-shadow: 0 2px 5px rgba(var(--ink-rgb),.14); background: var(--primary); }
.gantt-bar.green { background: var(--success); } .gantt-bar.orange { background: var(--warning); }
.gantt-cap-bar { background: var(--line); }
.gantt-bar.has-special { box-shadow: 0 2px 5px rgba(var(--ink-rgb),.14), 0 0 0 1px color-mix(in srgb, #6D28D9 40%, transparent) inset; }
.gantt-special-badge { position: absolute; top: 4px; right: 6px; z-index: 3; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 8px; background: #F0E9FC; color: #6D28D9; font-weight: 600; pointer-events: none; }
.gantt-milestone { border-radius: 6px; padding: 5px 8px; margin-bottom: 4px; font-size: 11px; line-height: 1.3; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); border: 1px dashed color-mix(in srgb, var(--primary) 55%, transparent); }
.gantt-milestone.late { background: color-mix(in srgb, var(--danger, #dc2626) 14%, transparent); color: var(--danger, #dc2626); border-color: color-mix(in srgb, var(--danger, #dc2626) 55%, transparent); }
.gantt-milestone.done { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border-color: color-mix(in srgb, var(--success) 55%, transparent); }
.po-milestone-cell { background: var(--surface); }
.funnel-card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.funnel-head b { font-size: 15px; color: var(--ink); }
.funnel-bar { width: 46px; border-radius: 6px 6px 0 0; }
.funnel-bar.blue { background: var(--primary); } .funnel-bar.orange { background: var(--warning); }
.funnel-bar.green { background: var(--success); } .funnel-bar.purple { background: #7a8794; } .funnel-bar.red { background: var(--danger); }
.funnel-num { color: var(--ink); font-weight: 800; }
.bar-col .bar { background: var(--primary); border-radius: 4px 4px 0 0; }
.target-ring { box-shadow: inset 0 0 0 4px rgba(var(--primary-rgb),.14); }
.target-ring > div { color: var(--primary); }
.board-greet { background: linear-gradient(100deg, var(--primary-light), var(--surface)); border-color: rgba(var(--primary-rgb),.18); border-radius: var(--radius); }
.greet-main b { color: var(--ink); }
.greet-tip { background: var(--success-light); color: var(--success); font-weight: 600; }

/* ---------- 工序 / 上手清单 / 共享文件卡片 ---------- */
.op-card { border-color: var(--line); border-radius: var(--radius-sm); transition: border-color .18s, box-shadow .18s; }
.op-card:hover { border-color: var(--primary); box-shadow: var(--shadow-1); }
.op-seq { background: var(--primary-light); color: var(--primary-ink); border-radius: var(--radius-sm); font-weight: 800; }
.check-item { border-radius: var(--radius-sm); transition: border-color .18s, transform .18s var(--ease); }
.check-item:hover { transform: translateX(2px); }
.file-item, .folder-card, .faq-list details { border-color: var(--line); box-shadow: var(--shadow-1); }

/* ---------- 弹窗 / Toast / 提示：层级与触感 ---------- */
.modal-mask { background: rgba(11,18,26,.6); backdrop-filter: blur(3px); }
.modal { border-radius: 14px; box-shadow: 0 24px 70px rgba(8,14,20,.35); animation: modal-in .28s var(--ease) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head h3 { color: var(--ink); font-weight: 700; }
.toast { background: var(--graphite); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 10px 30px rgba(8,14,20,.35); animation: toast-in .25s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%,-8px); } to { opacity: 1; transform: translate(-50%,0); } }
.notice-warn { border-left-color: var(--warning); }
.server-outdated-banner { border-radius: var(--radius-sm); box-shadow: var(--shadow-2); }

/* ---------- 移动端报工：钢蓝顶栏 ---------- */
.mobile-head { background: linear-gradient(120deg, var(--primary-dark), var(--primary)); }
.mobile-card { border-radius: var(--radius); box-shadow: var(--shadow-1); }

/* ---------- 无障碍：尊重减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   数据看台 · BI 仪表盘（浅色数据面板 + 等宽数字 + 内嵌 SVG 图表）
   ========================================================================== */
.dash-board { border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--surface); box-shadow:var(--shadow-1); margin-bottom:18px; }
.dash-titlebar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:13px 20px; background:linear-gradient(100deg, var(--primary-light), var(--surface)); border-bottom:1px solid var(--line); }
.dash-titlebar h2 { font-size:17px; font-weight:800; color:var(--ink); letter-spacing:-.01em; }
.dash-titlebar .row { gap:8px; }
.dash-body { padding:18px 20px 22px; background:linear-gradient(180deg,#f7fafc,var(--surface) 120px); }
.dash-board .board-greet { margin-bottom:16px; }

/* KPI 数字卡：顶部细色条 + 大号等宽数字 */
.dash-kpis { display:grid; grid-template-columns:repeat(6,1fr); gap:12px; margin-bottom:14px; }
.dash-kpi { position:relative; overflow:hidden; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:13px 14px; box-shadow:var(--shadow-1); display:flex; flex-direction:column; gap:3px; transition:transform .25s var(--ease), box-shadow .25s var(--ease); }
.dash-kpi::before { content:''; position:absolute; left:0; top:0; right:0; height:3px; background:var(--primary); }
.dash-kpi.green::before { background:var(--success); } .dash-kpi.cyan::before { background:#3aa7b5; }
.dash-kpi.amber::before { background:var(--accent); } .dash-kpi.red::before { background:var(--danger); }
.dash-kpi:hover { transform:translateY(-2px); box-shadow:var(--shadow-2); }
.dash-kpi span { font-size:12px; color:var(--muted); font-weight:600; }
.dash-kpi b { font-size:20px; font-weight:800; color:var(--ink); letter-spacing:-.02em; line-height:1.3; font-family: var(--font-num); font-variant-numeric:tabular-nums; }
.dash-kpi i { font-size:11px; color:var(--faint); font-style:normal; }

/* 面板与两列布局 */
.dash-row { display:grid; gap:14px; margin-bottom:14px; }
.dash-row-2 { grid-template-columns:repeat(2,1fr); }
.dash-mini, .dash-board .dash-panel { background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow-1); min-width:0; }
.dash-mini-head, .dash-board .dash-panel-head { display:flex; align-items:center; gap:10px; padding:11px 14px; border-bottom:1px solid var(--line-soft); }
.dash-mini-head { font-size:13px; font-weight:700; color:var(--ink); }
.dash-mini-head .tag { margin-left:auto; }
.dash-mini-head .tag + .tag { margin-left:0; }
.dash-board .dash-panel-head h3 { font-size:13px; font-weight:700; color:var(--ink); }
.dash-board .dash-panel-head .btn { margin-left:auto; }
.dash-mini-body, .dash-board .dash-panel-body { padding:12px 14px; }
.dash-svg { display:block; width:100%; height:168px; }
.dash-goal { display:flex; align-items:center; gap:14px; padding:12px 14px; margin-bottom:14px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.dash-goal b { color:var(--ink); }

/* 环形分布 + 图例 */
.dash-donut-wrap { display:flex; align-items:center; gap:18px; padding:4px 0 8px; }
.dash-donut { width:132px; height:132px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; box-shadow:0 3px 12px rgba(var(--ink-rgb),.1); }
.dash-donut-in { width:92px; height:92px; border-radius:50%; background:var(--surface); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.dash-donut-in b { font-size:24px; font-weight:800; color:var(--ink); line-height:1.1; }
.dash-donut-in span { font-size:11px; color:var(--muted); }
.dash-legend { flex:1; display:grid; grid-template-columns:repeat(2,1fr); gap:6px 12px; font-size:12px; min-width:0; }
.dash-legend div { display:flex; align-items:center; gap:6px; color:var(--ink-2); }
.dash-legend i { width:9px; height:9px; border-radius:2px; flex:none; }
.dash-legend b { margin-left:auto; font-family: var(--font-num); font-variant-numeric:tabular-nums; }

/* 排行条 */
.dash-rank { display:flex; flex-direction:column; gap:9px; }
.dash-rank-row { display:flex; align-items:center; gap:10px; font-size:12px; }
.dash-rank-row > span { min-width:96px; max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-2); }
.dash-rank-row .progress { flex:1; }
.dash-rank-row b { min-width:68px; text-align:right; font-family: var(--font-num); font-variant-numeric:tabular-nums; color:var(--ink); }

@media (max-width:1100px) { .dash-kpis { grid-template-columns:repeat(3,1fr); } }
@media (max-width:760px) { .dash-kpis { grid-template-columns:repeat(2,1fr); } .dash-row-2 { grid-template-columns:1fr; } .dash-donut-wrap { flex-direction:column; } }

/* ---------- 标准格式表 + 字段下拉映射 ---------- */
.import-cols { display:grid; grid-template-columns:repeat(3,1fr); gap:8px 12px; }
.import-col { display:flex; align-items:center; gap:8px; }
.import-col .small { flex:none; color:var(--muted); min-width:52px; }
.import-col select { flex:1; min-width:0; padding:7px 9px; border:1px solid var(--border); border-radius:7px; background:var(--surface); }
.std-import-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.std-import-table th { background:var(--surface-2); color:var(--ink-2); font-size:12px; font-weight:700; padding:8px 6px; border:1px solid var(--line); text-align:left; white-space:nowrap; }
.std-import-table td { padding:4px; border:1px solid var(--line-soft); }
.std-import-table .std-cell { width:100%; padding:6px 7px; border:1px solid transparent; border-radius:5px; font-size:12px; background:transparent; }
.std-import-table .std-cell:focus { border-color:var(--primary); background:var(--surface); outline:none; }
@media (max-width:760px){ .import-cols { grid-template-columns:1fr 1fr; } }

/* ==========================================================================
   手机端专用界面 · 清爽卡片式工作台（扫码 / 直接访问自动进入）
   ========================================================================== */
.mobile-page { padding: 0; background: var(--bg); }
.m-shell {
  display: flex; flex-direction: column; min-height: 100vh;
  max-width: 440px; margin: 0 auto; background: var(--bg);
  box-shadow: 0 0 40px rgba(8,14,20,.08);
}
.m-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 16px;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff;
}
.m-back { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 24px; line-height: 1; }
.m-head-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-head-user { flex: none; font-size: 12px; padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,.18); }
.m-head-user.locked { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); font-size: 11px; }
.m-main { flex: 1; padding: 14px 14px 24px; }

/* 工作台问候 */
.m-hero {
  border-radius: 14px; padding: 18px 18px 16px; margin-bottom: 12px; color: #fff;
  background: linear-gradient(120deg, #163a63, #2c6fb0 70%, #3a86cf);
  box-shadow: 0 8px 20px rgba(20,58,99,.22);
}
.m-hero-greet { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.m-hero-sub { margin-top: 5px; font-size: 12px; opacity: .85; }

/* 数据卡 */
.m-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.m-kpi {
  background:var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 8px; text-align: center; box-shadow: var(--shadow-1);
}
.m-kpi b { display: block; font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.m-kpi span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.m-kpi.orange b { color: var(--warning); }
.m-kpi.green b { color: var(--success); }

/* 快捷入口 */
.m-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.m-quick button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background:var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-align: left; box-shadow: var(--shadow-1);
}
.m-quick button:active { transform: scale(.98); }
.m-qi {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; margin-bottom: 4px;
  background: var(--success-light); color: var(--success); font-size: 18px;
}
.m-qi svg.ico { width: 18px; height: 18px; display: block; }
.m-qi.blue { background: var(--primary-light); color: var(--primary); }
.m-qi.green { background: rgba(22,163,74,.12); color: #15803d; }
.m-qi.orange { background: rgba(230,126,34,.12); color: #c05621; }
.m-qi.red { background: rgba(220,38,38,.12); color: #dc2626; }
.m-kpi.red b { color: var(--danger, #dc2626); }
.m-rec { color: var(--success, #15803d); font-size: 11px; }
.m-quick b { font-size: 14px; color: var(--ink); }
.m-quick small { font-size: 11px; color: var(--muted); }

/* 分区标题 */
.m-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 10px; }
.m-sec-head b { font-size: 15px; color: var(--ink); }
.m-sec-head span { font-size: 11px; color: var(--muted); }

/* 手机领料 */
.m-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-1); }

/* 异常呼叫：三类一键按钮 */
.m-call-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-call-type { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; box-shadow: var(--shadow-1); }
.m-call-type .m-call-icon { font-size: 24px; line-height: 1; }
.m-call-type b { font-size: 15px; color: var(--ink); }
.m-call-type small { font-size: 10px; color: var(--muted); line-height: 1.3; text-align: center; }
.m-call-type.orange .m-call-icon { color: #c05621; }
.m-call-type.red .m-call-icon { color: #dc2626; }
.m-call-type.blue .m-call-icon { color: var(--primary); }
.m-call-type.sel { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary-light); }
.m-issue-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.m-issue-line select { flex: 1; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.m-issue-line input { padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.m-issue-del { flex: none; width: 32px; height: 32px; border: none; border-radius: 8px; background: var(--danger-light, rgba(220,38,38,.12)); color: var(--danger, #dc2626); font-size: 18px; line-height: 1; cursor: pointer; }

/* 扫码锚定 */
.m-scan-btn { margin-top: 10px; }
.m-scan-result { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--primary-light); color: var(--primary-ink); font-size: 13px; }
.m-scan-result.hidden { display: none; }
.m-scan-box video { width: 100%; border-radius: 10px; background: #000; }
.m-scan-box { text-align: center; }


/* 工序列表 */
.m-oplist { display: flex; flex-direction: column; gap: 9px; }
.m-op {
  display: flex; align-items: center; gap: 11px;
  background:var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px; box-shadow: var(--shadow-1);
}
.m-op-seq {
  width: 44px; height: 44px; flex: none; border-radius: 9px;
  background: var(--primary-light); color: var(--primary-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.m-op-info { flex: 1; min-width: 0; }
.m-op-name { font-size: 14px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-op-meta { margin-top: 3px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-op-btn {
  flex: none; border: 0; border-radius: 8px; padding: 9px 16px;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 700;
}
.m-op-btn:active { transform: scale(.96); }
.m-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; background:var(--surface); border-radius: 11px; border: 1px dashed var(--line); }

/* 扫码落地页：零件卡 */
.m-part-card {
  background:var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-1);
}
.m-part-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-part-top b { font-size: 17px; color: var(--ink); }
.m-part-tag { flex: none; font-size: 11px; font-weight: 700; color: var(--success); background: var(--success-light); padding: 3px 10px; border-radius: 20px; }
.m-part-code { margin-top: 4px; font-size: 12px; color: var(--muted); }
.m-part-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.m-part-grid > div { text-align: center; }
.m-part-grid span { display: block; font-size: 11px; color: var(--muted); }
.m-part-grid b { display: block; margin-top: 3px; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-tip { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--primary-light); color: var(--primary-ink); font-size: 12px; line-height: 1.6; }

/* 订单卡片 */
.m-order { background:var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
.m-order-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-order-top b { font-size: 14px; color: var(--ink); }
.m-order-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.m-order-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.m-order-parts span { font-size: 11px; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.m-order-part { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); }
.m-order-part-name { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.m-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.m-flow span { font-size: 11px; line-height: 1.4; padding: 3px 7px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
.m-flow span.ready { background: var(--primary-light); color: var(--primary-ink); font-weight: 700; }
.m-flow span.done { background: var(--success-light); color: var(--success); text-decoration: line-through; }
.m-flow i { font-style: normal; font-size: 11px; color: var(--muted); }

/* 我的任务：进度 + 现场照片 */
.m-hero.compact { padding: 16px; }
.m-task-list { display: flex; flex-direction: column; gap: 10px; }
.m-task-card { background:var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow-1); }
.m-task-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-task-top b { font-size: 14px; color: var(--ink); }
.m-task-meta { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.m-task-bar { height: 6px; margin-top: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.m-task-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); }
.m-task-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.m-task-actions .btn { flex: 1 1 auto; }
.m-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* 我的 */
.m-me-card { display: flex; align-items: center; gap: 14px; background:var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 18px; box-shadow: var(--shadow-1); }
.m-avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.m-me-card b { font-size: 16px; color: var(--ink); }
.m-me-list { margin: 12px 0; background:var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.m-me-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.m-me-row:last-child { border-bottom: 0; }
.m-me-row span { color: var(--muted); }
.m-me-row b { color: var(--ink); }
.m-logout { width: 100%; padding: 13px; border: 1px solid var(--danger); border-radius: 10px; background:var(--surface); color: var(--danger); font-size: 14px; font-weight: 700; }

/* 加载态 */
.m-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 80px 20px; text-align: center; }
.m-loading b { font-size: 15px; color: var(--ink); }
.m-loading span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.m-spinner { width: 38px; height: 38px; border: 3px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: m-spin .8s linear infinite; }
@keyframes m-spin { to { transform: rotate(360deg); } }

/* 底部标签栏 */
.m-tabs {
  position: sticky; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background:var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 14px rgba(8,14,20,.05);
}
.m-tabs button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; padding: 5px 0; }
.m-tabs button span { font-size: 20px; line-height: 1; }
.m-tabs button svg.ico { width: 20px; height: 20px; display: block; }
.m-tabs button.on { color: var(--primary); font-weight: 700; }

/* 移动端弹窗：底部抽屉 + 单列表单 */
@media (max-width: 760px) {
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal .grid-2, .modal .grid-3, .modal .grid-4 { grid-template-columns: 1fr; }
  .modal .form-item input, .modal .form-item select, .modal .form-item textarea { font-size: 16px; }
}

/* ---------- 手机首次绑定使用者 ---------- */
.m-bind { padding: 6px 2px 20px; }
.m-bind-icon { width: 62px; height: 62px; margin: 14px auto 14px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.m-bind-icon svg.ico { width: 30px; height: 30px; display: block; }
.m-bind h2 { text-align: center; font-size: 18px; font-weight: 800; color: var(--ink); }
.m-bind > p { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; margin: 8px 16px 20px; }
.m-bind-sec { font-size: 13px; font-weight: 700; color: var(--ink); margin: 16px 2px 10px; }
.m-bind-list { display: flex; flex-direction: column; gap: 8px; }
.m-bind-emp { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background:var(--surface); border: 1px solid var(--line); border-radius: 11px; text-align: left; box-shadow: var(--shadow-1); }
.m-bind-emp:active { transform: scale(.98); border-color: var(--primary); }
.m-bind-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; }
.m-bind-info { display: flex; flex-direction: column; }
.m-bind-info b { font-size: 14px; color: var(--ink); }
.m-bind-info small { font-size: 11px; color: var(--muted); }
.m-bind-custom { display: flex; gap: 8px; }
.m-bind-custom input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background:var(--surface); font-size: 16px; }
.m-bind-custom button { flex: none; padding: 0 20px; border: 0; border-radius: 9px; background: var(--primary); color: #fff; font-weight: 700; }
.m-bind-note { margin-top: 22px; padding: 12px 14px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }

/* ==========================================================================
   专业打印单据 · A4 纸张（送货/出入库/领料/开票/对账/外协/流转卡）
   ========================================================================== */
.doc-paper {
  max-width: 210mm; margin: 0 auto; background:var(--surface); color: #1a2430;
  padding: 14mm 13mm 12mm; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  box-shadow: 0 6px 26px rgba(8, 14, 20, .14); font-size: 12px; line-height: 1.5;
}
.doc-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 3px double #173a61; }
.doc-brand { width: 48px; height: 48px; flex: none; border: 2px solid #173a61; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #173a61; font-weight: 800; font-size: 15px; }
.doc-brand img { width: 100%; height: 100%; object-fit: contain; }
.doc-company { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-company b { font-size: 17px; color: #163a63; letter-spacing: 1px; }
.doc-company span { font-size: 11px; color: #5c6b7a; margin-top: 2px; }
.doc-title-wrap { flex: none; text-align: right; }
.doc-title { font-size: 25px; font-weight: 800; color: #163a63; letter-spacing: 5px; line-height: 1.2; }
.doc-no { margin-top: 4px; font-size: 11px; color: #5c6b7a; font-family: Consolas, monospace; }
.doc-info { width: 100%; border-collapse: collapse; margin: 12px 0; table-layout: fixed; }
.doc-info th, .doc-info td { border: 1px solid #c9d5e2; padding: 6px 9px; font-size: 11px; text-align: left; overflow: hidden; word-break: break-all; }
.doc-info th { width: 14%; background: #eef3f8; color: #37506b; font-weight: 700; }
.doc-info td { width: 36%; color: #1a2430; }
.doc-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.doc-table th { background: linear-gradient(180deg, #2a5f96, #1d4a78); color: #fff; font-size: 11px; font-weight: 700; padding: 8px 5px; border: 1px solid #1d4a78; text-align: center; }
.doc-table td { border: 1px solid #c9d5e2; padding: 7px 5px; text-align: center; font-size: 11px; word-break: break-all; }
.doc-table tbody tr:nth-child(even) td { background:var(--surface-2); }
.doc-table td.doc-empty { padding: 26px; color: #8a98a7; }
.doc-totals { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.doc-upper { font-size: 12px; color: #37506b; }
.doc-upper b { color: #163a63; }
.doc-sum { display: flex; gap: 18px; font-size: 12px; color: #37506b; }
.doc-sum b { color: #163a63; font-size: 13px; }
.doc-note { margin-top: 14px; padding: 8px 10px; background: #f4f7fa; border-left: 3px solid #7d9ab8; color: #5c6b7a; font-size: 11px; }
.doc-sign { display: flex; gap: 22px; margin-top: 26px; }
.doc-sign > div { flex: 1; font-size: 12px; color: #37506b; display: flex; align-items: baseline; gap: 6px; }
.doc-sign i { flex: 1; border-bottom: 1px solid #8fa2b5; height: 18px; }
.doc-foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #dbe3ec; text-align: center; font-size: 10px; color: #8a98a7; }
/* 独立打印舞台：打印前把单据克隆到这里，避免被弹窗/侧栏的 display:none 一并隐藏 */
#printStage { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }
  /* 不用 visibility 树状隐藏：祖先 display:none 会让后代永远不可见（Windows 打印对话框显示"没有可用的预览"） */
  body > *:not(#printStage) { display: none !important; }
  #printStage { display: block !important; position: static !important; width: 100% !important; }
  #printStage .doc-paper { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; break-inside: avoid; page-break-inside: avoid; }
  #printStage .doc-head, #printStage .doc-info, #printStage .doc-table, #printStage .doc-totals { break-inside: avoid; page-break-inside: avoid; }
  #printStage img { max-width: 100% !important; }
}

/* ---------- 交期风险标识 ---------- */
.risk-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.risk-badge.safe { background: var(--success-light); color: var(--success); }
.risk-badge.watch { background: var(--primary-light); color: var(--primary); }
.risk-badge.warn { background: var(--warning-light); color: var(--warning); }
.risk-badge.critical { background: var(--danger-light); color: var(--danger); }
.risk-card { border-left: 4px solid var(--danger); }
.risk-card.warn { border-left-color: var(--warning); }
.risk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.risk-stat { background:var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: var(--shadow-1); }
.risk-stat b { display: block; font-size: 28px; line-height: 1.1; }
.risk-stat span { font-size: 12px; color: var(--muted); }
.risk-reason { color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ---------- 班次加班时段配置 ---------- */
.shift-ot { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 8px; background: #f2f6fb; border-radius: 6px; font-size: 12px; color: #37506b; }
.shift-ot input[type="checkbox"] { accent-color: var(--primary); }
.shift-ot input[type="time"] { padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }
.shift-block.ot { background: linear-gradient(90deg, var(--primary) 70%, var(--warning) 30%) !important; color: #fff; }
.doc-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.doc-type { background:var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: left; box-shadow: var(--shadow-1); cursor: pointer; }
.doc-type:hover { border-color: var(--primary); transform: translateY(-2px); }
.doc-type .ico { font-size: 24px; color: var(--primary); }
.doc-type .ico svg.ico { width: 24px; height: 24px; display: block; }
.doc-type b { display: block; margin-top: 8px; font-size: 14px; color: var(--ink); }
.doc-type small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
@media (max-width: 900px) { .risk-grid, .doc-type-grid { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================================================
   专业物料管理 · 主数据台账 / 预警清单 / 流水查询 / 盘点
   ========================================================================== */
.mat-table { min-width: 1080px; }
.mat-table th { white-space: nowrap; }
.mat-table td { vertical-align: middle; }
.mat-table .risk-row { background: rgba(184,84,80,.055); }
.mat-table .risk-row:hover { background: rgba(184,84,80,.09); }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 11px; color: var(--text-2, #44546a); letter-spacing: .2px; }
.mat-alerts { display: flex; flex-direction: column; gap: 7px; }
.mat-alert { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid var(--warning); border-radius: 8px; background: var(--surface-1, #fff); font-size: 12px; }
.mat-alert.low { border-left-color: var(--danger); }
.mat-alert b { color: var(--ink, #1a2430); }
.mat-alert .muted { margin-right: auto; }
.mat-query { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mat-query input, .mat-query select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-1, #fff); font-size: 12px; }
.mat-query input#iq_code { min-width: 180px; }
.mat-query-sum { padding: 8px 11px; border-radius: 7px; background: var(--primary-light, #eef3f8); color: var(--primary-ink, #37506b); font-size: 12px; margin-bottom: 10px; }
.mat-query-sum b { color: var(--primary, #1d4a78); }
.mt { margin-top: 12px; }

/* ==========================================================================
   物流联网跟踪 · 进度条 / 当前位置 / 轨迹时间线
   ========================================================================== */
.lg-card { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; overflow: hidden; background: var(--surface-1, #fff); }
.lg-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-2, #f7f9fc); border-bottom: 1px solid var(--line); }
.lg-body { padding: 16px; }
.lg-progress { display: flex; align-items: flex-start; margin: 4px 0 18px; position: relative; }
.lg-progress::before { content: ''; position: absolute; top: 12px; left: 8%; right: 8%; height: 3px; background: var(--line); z-index: 0; }
.lg-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; z-index: 1; font-size: 11px; color: var(--muted); }
.lg-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-1, #fff); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.lg-step.done .lg-dot { background: var(--success); border-color: var(--success); color: #fff; }
.lg-step.active .lg-dot { background: var(--primary, #1d4a78); border-color: var(--primary, #1d4a78); color: #fff; box-shadow: 0 0 0 4px rgba(var(--primary-rgb),.14); }
.lg-step.active .lg-label { color: var(--primary, #1d4a78); font-weight: 700; }
.lg-step.done .lg-label { color: var(--success); }
.lg-current { padding: 10px 13px; border-radius: 8px; background: var(--primary-light, #eef3f8); font-size: 12px; margin-bottom: 14px; }
.lg-current .text-primary { color: var(--primary, #1d4a78); font-weight: 700; }
.lg-timeline { display: flex; flex-direction: column; }
.lg-trace { border-left: 2px solid var(--line); padding: 7px 0 7px 13px; margin-left: 6px; font-size: 12px; position: relative; }
.lg-trace::before { content: ''; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.lg-trace.first { border-left-color: var(--primary, #1d4a78); }
.lg-trace.first::before { background: var(--primary, #1d4a78); }
.lg-trace .tag { margin-right: 8px; }
.doc-info-wrap { margin-bottom: 12px; }

/* ==========================================================================
   CAD 3D 预览：悬停缩略 / 查看大图
   ========================================================================== */
.peek-file-icon { display: flex; align-items: center; justify-content: center; height: 150px; border-radius: 8px; background: linear-gradient(160deg,var(--primary-light),#d8e5f2); color: var(--primary); font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.cad-peek { min-height: 150px; }
.cad-peek .cad-viewport { margin-top: 4px; }
.cad-peek-loading { text-align: center; padding: 6px 0; }
.cad-big-wrap { min-height: 420px; }
.cad-big-host { width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cad-big-host .cad-viewport { width: 100% !important; }
.cad-big-host canvas { display: block; }

/* ==========================================================================
   全局剪贴板：输入框右键菜单 + 聚焦快捷工具条
   ========================================================================== */
.clip-menu { position: fixed; z-index: 100000; min-width: 168px; background:var(--surface); border: 1px solid var(--border, #d9dfe7); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: 4px; }
.clip-menu button { display: flex; align-items: center; width: 100%; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: 5px; font-size: 13px; color: var(--text, #1f2937); cursor: pointer; text-align: left; }
.clip-menu button:hover { background: var(--primary-light, #eef4fa); color: var(--primary, #1d4a78); }
.clip-menu .clip-ico { width: 18px; text-align: center; }
.clip-menu .clip-key { margin-left: auto; font-size: 11px; color: var(--text-muted, #9ca3af); }
.clip-bar { position: fixed; z-index: 99999; display: flex; gap: 2px; background:var(--surface); border: 1px solid var(--border, #d9dfe7); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 3px; pointer-events: none; }
.clip-bar button { pointer-events: auto; border: 0; background: none; padding: 4px 8px; border-radius: 4px; font-size: 11px; color: var(--primary, #1d4a78); cursor: pointer; white-space: nowrap; }
.clip-bar button:hover { background: var(--primary-light, #eef4fa); }

/* ==========================================================================
   数控作业指导书 · 三页板书版（预览样式，打印样式在 js/print.js 的 WI_STYLE）
   ========================================================================== */
.wi-doc{font-family:"Microsoft YaHei","宋体",Arial,sans-serif;color:#20242b;font-size:7pt;line-height:1.25}
.wi-page{width:100%;margin:0 auto 6mm;page-break-after:always;break-after:page}
.wi-page:last-child{page-break-after:auto;break-after:auto;margin-bottom:0}
.wi-tbl{width:100%;border-collapse:collapse;table-layout:fixed}
.wi-tbl td,.wi-tbl th{border:1px solid #9aa0a6;padding:2px 3px;vertical-align:middle;text-align:center;word-break:break-all;overflow-wrap:break-word}
.wi-tbl th{background:#eef2f6;font-weight:700}
.wi-head td{border:1px solid #9aa0a6;padding:2px 3px;vertical-align:middle;text-align:center}
.wi-head .wi-brand{font-weight:700;font-size:10pt}
.wi-head .wi-title{font-weight:800;font-size:11pt;color:#1f3864;letter-spacing:1px}
.wi-head .wi-lbl{font-size:7pt;white-space:nowrap}
.wi-head .wi-val{font-weight:700;font-size:7.5pt}
.wi-head .wi-small{font-size:6.5pt}
.wi-sec{font-weight:700;background:#eef2f6;text-align:center;font-size:7pt}
.wi-figure{border:1px solid #9aa0a6;min-height:125px;display:flex;align-items:center;justify-content:center;color:#9aa0a6;font-size:8pt;background:var(--surface)}
.wi-figure img{max-width:100%;max-height:150px;display:block}
.wi-step td{font-size:6.5pt;text-align:left;vertical-align:top;line-height:1.3}
.wi-step td.wi-c{text-align:center;vertical-align:middle}
.wi-step th{font-size:7pt}
.wi-sign td{height:22px;font-size:7pt;text-align:left}
.wi-sign td b{display:block;font-weight:400;font-size:6.5pt;color:#555}
.wi-rev td{font-size:6.5pt;height:16px}
.wi-qrbox{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px}
.wi-qrbox img{width:40px;height:40px;image-rendering:pixelated}
.wi-qrbox span{font-size:5pt;color:#1f3864;white-space:normal;text-align:center;line-height:1.1;width:100%}
.wi-progress{font-size:6pt;color:#1f3864;font-weight:700;text-align:center}
.wi-ap-tip{font-size:8pt;font-weight:700;text-align:left;padding:4px 6px}
.wi-ap-meta td{font-size:7pt;text-align:left;height:20px}
.wi-foot{font-size:6pt;color:#888;text-align:center;margin-top:2px;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.wi-quick td{text-align:left;font-size:6.5pt;line-height:1.35;padding:3px 5px}
.wi-quick td b{color:#1f3864;font-weight:800}
.wi-figtitle{font-size:7pt;font-weight:700;text-align:left;padding:2px 4px}
.wi-fig-note{font-size:6pt;color:#8a5a00;text-align:left;padding:2px 4px;background:#fffbe8}
.wi-ccp{background:#fff6d9 !important}
.wi-ccp td{font-weight:700}
.wi-ccp .wi-ccptag{color:#b26a00;font-weight:800}
.wi-param td,.wi-param th{font-size:6.2pt;text-align:center}
.wi-abn td,.wi-abn th{font-size:6.3pt;text-align:left;line-height:1.3}
.wi-source{font-size:6pt;color:#555;text-align:left;padding:2px 4px;line-height:1.4}
.wi-signoff td{font-size:6.5pt;height:20px;text-align:left}
.wi-doc img{max-width:100%}
.doc-paper.wi-doc{max-width:210mm;padding:0;box-shadow:0 6px 26px rgba(8,14,20,.14)}
#printStage .wi-page{page-break-after:always;break-after:page}
#printStage .wi-page:last-child{page-break-after:auto;break-after:auto}

/* ==========================================================================
   作业指导书模板配置界面 + 全流程进度落地页
   ========================================================================== */
.wi-cfg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--border, #d9dfe7); padding-bottom: 8px; }
.wi-cfg-sub { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; }
.wi-cfg-table { width: 100%; border-collapse: collapse; }
.wi-cfg-table th, .wi-cfg-table td { border: 1px solid var(--border, #d9dfe7); padding: 4px 6px; font-size: 12px; text-align: left; }
.wi-cfg-table th { background: var(--primary-light, #eef4fa); font-weight: 600; }
.wi-cfg-table input { width: 100%; border: 0; background: transparent; font-size: 12px; color: var(--text, #1f2937); }
.wi-step-cfg { border: 1px solid var(--border, #d9dfe7); border-radius: 6px; padding: 8px; margin-bottom: 8px; background: var(--bg-soft, #f8fafc); }
.wi-progress-card { background:var(--surface); border: 1px solid var(--border, #d9dfe7); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.wi-pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wi-pc-pct { font-size: 30px; font-weight: 800; color: var(--primary, #1d4a78); }
.wi-pc-pct small { font-size: 14px; }
.wi-pc-bar { height: 8px; background: #e5eaf0; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.wi-pc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }
.wi-flow { background:var(--surface); border: 1px solid var(--border, #d9dfe7); border-radius: 10px; padding: 12px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wi-flow-node { flex: 1 1 28%; min-width: 78px; text-align: center; font-size: 11px; color: #9aa3ae; }
.wi-flow-node .wi-flow-dot { display: block; width: 22px; height: 22px; line-height: 22px; margin: 0 auto 4px; border-radius: 50%; background: #e5eaf0; color: #9aa3ae; font-weight: 700; }
.wi-flow-node.done { color: var(--primary); }
.wi-flow-node.done .wi-flow-dot { background: var(--primary); color: #fff; }
.wi-flow-node.now { color: #c2410c; font-weight: 700; }
.wi-flow-node.now .wi-flow-dot { background: #f59e0b; color: #fff; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.wi-op-row { background:var(--surface); border: 1px solid var(--border, #d9dfe7); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.wi-op-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.wi-op-meta { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 5px; }
.m-head-inline { font-weight: 700; font-size: 13px; margin: 12px 0 8px; color: var(--text, #1f2937); }

/* ==========================================================================
   ERP 扩展：多级 BOM / 采购与来料检 / 质量体系 / 计件工资
   ========================================================================== */
.bom-list-item { padding: 9px 10px; border: 1px solid var(--border, #d9dfe7); border-radius: 6px; margin-bottom: 7px; cursor: pointer; background: var(--bg-soft, #f8fafc); }
.bom-list-item:hover { border-color: var(--primary, #1d4a78); }
.bom-list-item.active { border-color: var(--primary, #1d4a78); background: var(--primary-light, #eef4fa); box-shadow: inset 3px 0 0 var(--primary, #1d4a78); }
.bom-list-item .muted { margin-top: 3px; }
.mat-table tfoot th { background: var(--primary-light, #eef4fa); text-align: right; padding: 7px; border-top: 1px solid var(--border, #d9dfe7); }

/* ==========================================================================
   报工流程引导 + 现场照片管理（v1.8.5）
   ========================================================================== */
.work-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 9px 10px; margin-bottom: 10px; border: 1px solid var(--border, #d9dfe7); border-radius: 8px; background: var(--bg-soft, #f8fafc); }
.wf-step { font-size: 11px; padding: 3px 8px; border-radius: 12px; color: var(--text-muted, #6b7280); background: #e9edf2; white-space: nowrap; }
.wf-step.done { color: #fff; background: var(--primary); }
.wf-step.now { color: #fff; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); font-weight: 700; }
.wf-arrow { color: var(--text-muted, #9aa3ae); font-size: 12px; }
.wf-tip { margin-bottom: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-card { border: 1px solid var(--border, #d9dfe7); border-radius: 9px; padding: 8px; background: var(--bg-soft, #f8fafc); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.photo-card:hover { border-color: var(--primary, #1d4a78); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.photo-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 7px; }
.photo-meta { font-size: 12px; margin-bottom: 3px; }
.photo-view { text-align: center; }
.photo-view img { max-width: 100%; max-height: 68vh; border-radius: 6px; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.photo-thumb { position: relative; width: 90px; }
.photo-thumb img { width: 90px; height: 68px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border, #d9dfe7); display: block; }
.photo-thumb-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; line-height: 18px; padding: 0; border: none; border-radius: 50%; background: #d93025; color: #fff; font-size: 13px; cursor: pointer; }
.m-guide-step { display: flex; gap: 10px; align-items: flex-start; background:var(--surface); border: 1px solid var(--line, #e5eaf0); border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; }
.m-guide-no { flex: none; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: var(--primary, #1d4a78); color: #fff; font-size: 12px; font-weight: 700; }
.m-guide-step b { font-size: 13px; }
.guide-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.guide-flow span { font-size: 12px; padding: 4px 9px; border-radius: 12px; background: var(--primary-light, #eef4fa); color: var(--primary, #1d4a78); }
.guide-flow i { font-style: normal; color: var(--muted, #6b7280); }

/* ==========================================================================
   取长补短增强 v1.8.7：虚拟表格 / 综合工作台 / 甘特排程 / 右键菜单
   ========================================================================== */
/* --- 虚拟滚动表格 --- */
.vt { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background:var(--surface); }
.vt-head { overflow: hidden; background: var(--bg, #f5f7fa); border-bottom: 1px solid var(--border); }
.vt-head-inner { display: flex; }
.vt-th { flex: none; padding: 9px 10px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: default; user-select: none; border-right: 1px solid var(--border); white-space: nowrap; }
.vt-th[data-i] { cursor: pointer; }
.vt-th.sorted { color: var(--primary); }
.vt-sort { font-size: 10px; }
.vt-body { position: relative; overflow: auto; }
.vt-spacer { position: absolute; top: 0; left: 0; width: 1px; }
.vt-rows { position: absolute; top: 0; left: 0; will-change: transform; }
.vt-row { display: flex; border-bottom: 1px solid var(--border); cursor: pointer; background:var(--surface); }
.vt-row:hover { background: var(--primary-light); }
.vt-row.odd { background: #fafbfc; }
.vt-row.odd:hover { background: var(--primary-light); }
.vt-td { flex: none; padding: 0 10px; display: flex; align-items: center; font-size: 13px; border-right: 1px solid #f0f2f5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vt-empty { position: sticky; left: 0; top: 40%; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; pointer-events: none; }
.vt-foot { display: flex; justify-content: space-between; padding: 7px 10px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg); }
.bd-search { flex: 1; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; }

/* --- 右键菜单 --- */
.ctx-menu { position: fixed; z-index: 60000; min-width: 150px; background:var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.16); padding: 5px; }
.ctx-item { padding: 8px 11px; font-size: 13px; border-radius: 5px; cursor: pointer; }
.ctx-item:hover { background: var(--primary-light); color: var(--primary); }
.ctx-item.danger:hover { background: var(--danger-light); color: var(--danger); }

/* --- 综合工作台 --- */
.wb { display: flex; gap: 10px; min-height: 600px; }
.wb-pane { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; display: flex; flex-direction: column; background:var(--surface); }
.wb-pane.wb-left { flex: 0.85; }
.wb-pane.wb-mid { flex: 1.3; }
.wb-pane.wb-right { flex: 1; }
.wb.no-left .wb-left, .wb.no-mid .wb-mid, .wb.no-right .wb-right { display: none; }
.wb-pane-hd { padding: 9px 12px; font-size: 13px; font-weight: 600; background: var(--bg); border-bottom: 1px solid var(--border); }
.wb-pane-body { flex: 1; overflow: auto; padding: 10px; }
.wb-order { border: 1px solid var(--border); border-radius: 7px; margin-bottom: 8px; overflow: hidden; }
.wb-order.active { border-color: var(--primary); }
.wb-order-hd { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; cursor: pointer; background: var(--bg); }
.wb-order-hd:hover { background: var(--primary-light); }
.wb-ocode { font-weight: 600; font-size: 13px; }
.wb-order-parts { padding: 4px 0; }
.wb-part { display: flex; justify-content: space-between; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.wb-part:hover { background: var(--primary-light); }
.wb-part.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.wb-part-title { padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.wb-draw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wb-draw { border: 1px solid var(--border); border-radius: 7px; overflow: hidden; cursor: pointer; }
.wb-draw:hover { border-color: var(--primary); }
.wb-draw img { width: 100%; height: 120px; object-fit: cover; display: block; }
.wb-draw-ph { width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--text-muted); font-size: 22px; font-weight: 600; }
.wb-draw-name { padding: 6px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-mid-actions { display: flex; gap: 8px; margin-top: 12px; }
.wb-empty { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 180px; text-align: center; color: var(--text-muted); font-size: 13px; line-height: 2; }
.wb-flow { display: flex; flex-direction: column; }
.wb-step { display: flex; gap: 9px; padding: 9px; border: 1px solid var(--border); border-radius: 7px; margin-bottom: 8px; cursor: pointer; }
.wb-step:hover { border-color: var(--primary); }
.wb-step.done { border-left: 3px solid var(--success); }
.wb-step.running { border-left: 3px solid var(--warning); }
.wb-step-no { flex: none; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: var(--bg); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.wb-step.done .wb-step-no { background: var(--success); color: #fff; }
.wb-step.running .wb-step-no { background: var(--warning); color: #fff; }
.wb-step-body { flex: 1; min-width: 0; }
.wb-step-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.mini-ok { font-size: 10px; color: #fff; background: var(--primary); border-radius: 3px; padding: 1px 4px; }

/* --- 甘特排程 --- */
.gt-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); }
.gt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gt-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.gt-legend .gt-promise-i { background:var(--surface); border: 2px dashed #dc2626; }
.gt-legend .gt-today-i { background: #111827; width: 2px; }
.gt-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.gt-inner { position: relative; }
.gt-axis-row, .gt-row { display: flex; border-bottom: 1px solid var(--border); }
.gt-label { flex: none; width: 190px; padding: 7px 10px; border-right: 1px solid var(--border); background:var(--surface); position: sticky; left: 0; z-index: 2; display: flex; flex-direction: column; overflow: hidden; }
.gt-label b { font-size: 12px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.gt-axis-label { font-size: 12px; font-weight: 600; color: var(--text-muted); justify-content: center; background: var(--bg); }
.gt-axis, .gt-track { position: relative; flex: none; }
.gt-axis { height: 38px; background: #EEF3F8; border-bottom: 1px solid var(--line); }
.gt-tick { position: absolute; top: 4px; display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--muted); }
.gt-tick b { font-weight: 500; color: var(--ink); }
.gt-tick span { font-size: 11px; font-weight: 500; }
.gt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); z-index: 3; }
.gt-row { min-height: 40px; align-items: stretch; }
.gt-row:hover .gt-label { background: var(--primary-light); cursor: pointer; }
.gt-track { min-height: 40px; background-color: #fff; }
.gt-bar { position: absolute; top: 8px; height: 24px; border-radius: 3px; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; overflow: hidden; white-space: nowrap; border: 1px solid rgba(15,23,42,.12); box-shadow: 0 1px 2px rgba(15,23,42,.18); }
.gt-bar-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.gt-bar-end { opacity: .85; font-size: 10px; }
.gt-promise { position: absolute; top: 2px; bottom: 2px; width: 0; border-left: 2px dashed #B42318; z-index: 2; }
@media (max-width: 769px) {
  .wb { flex-direction: column; }
  .wb-pane, .wb-pane.wb-left, .wb-pane.wb-mid, .wb-pane.wb-right { flex: none; width: 100%; min-height: 240px; }
}

/* ==========================================================================
   岗位职责隔离 v1.8.8：灰白禁用 + 岗位职责定义页
   ========================================================================== */
/* 与当前岗位无关的录入点：灰白且不可点击，但工艺流程/上下游只读可见 */
.duty-locked, .duty-locked:disabled {
  opacity: .42 !important;
  filter: grayscale(1) !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
  box-shadow: none !important;
}
.duty-locked:hover { border-color: var(--border) !important; color: var(--text) !important; }
.duty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.duty-role { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background:var(--surface); }
.duty-role-hd { display: flex; justify-content: space-between; align-items: center; padding: 9px 11px; background: var(--bg); border-bottom: 1px solid var(--border); }
.duty-role-body { padding: 10px 11px; }
.duty-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.duty-chip { font-size: 11px; padding: 3px 8px; border-radius: 12px; background: #eef0f3; color: var(--text-muted); }
.duty-chip.on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.duty-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-top: 8px; }
.duty-check-item { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; }
.duty-check-item:hover { border-color: var(--primary); background: var(--primary-light); }
.notice-info { padding: 10px 12px; border-radius: 8px; background: var(--primary-light); border: 1px solid var(--border); font-size: 13px; }

/* ==================== v1.9.0 工业外壳：深蓝工业风 + 灰白极简 ==================== */
:root {
  --primary: #0A3D6B; --primary-dark: #062B4C; --primary-light: #E8F0F7; --accent: #0A3D6B;
  --ink: #1C2733; --muted: #5A6672; --line: #D8DEE5; --canvas: #F2F4F7; --surface: #FFFFFF;
  --sidebar: #0f2740; --sidebar-hover: #17395c;
  --text: var(--ink); --text-muted: var(--muted); --border: var(--line);
  --bg: var(--canvas); --card: var(--surface);
  --shadow: none; --shadow-1: none; --shadow-2: none; --shadow-3: none;
}
.app {
  display: grid; grid-template-columns: 232px minmax(0,1fr);
  grid-template-rows: auto minmax(0,1fr) auto;
  grid-template-areas: "ribbon ribbon" "side main" "status status";
  height: 100vh; min-height: 100vh; overflow: hidden;
}
.shell-ribbon { grid-area: ribbon; }
.sidebar { grid-area: side; width: auto; height: auto; position: static; overflow-y: auto; border-right: 1px solid #0E1821; }
.main { grid-area: main; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.shell-status { grid-area: status; }
.shell-main-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.page { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px 32px; }
.topbar { height: 48px; flex: none; padding: 0 20px; }
.crumb { font-size: 15px; font-weight: 500; }

.shell-ribbon { display: flex; align-items: stretch; min-height: 104px; background: var(--primary); color: #fff; border-bottom: 1px solid var(--primary-dark); }
.shell-rb-head { width: 232px; flex: none; border-right: 1px solid rgba(255,255,255,.18); display: flex; flex-direction: column; }
.shell-rb-id { height: 38px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.shell-rb-mark { width: 26px; height: 22px; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--primary); border-radius: 2px; font-size: 10px; font-weight: 500; letter-spacing: .5px; }
.shell-rb-title { flex: 1; font-size: 13px; font-weight: 500; color: #fff; }
.shell-rb-icon { border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; width: 24px; height: 22px; border-radius: 3px; font-size: 12px; padding: 0; }
.shell-rb-icon:hover { background: rgba(255,255,255,.14); }
.shell-rb-qat { flex: 1; display: flex; align-items: center; gap: 3px; padding: 0 10px; }
.shell-rb-qat button { width: 24px; height: 20px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: #fff; border-radius: 3px; font-size: 11px; padding: 0; }
.shell-rb-qat button:hover { background: rgba(255,255,255,.25); }
.shell-rb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell-rb-tabs { height: 30px; display: flex; align-items: stretch; gap: 2px; padding: 0 10px; border-bottom: 1px solid rgba(255,255,255,.16); overflow-x: auto; }
.shell-rb-tab { border: 0; background: transparent; color: rgba(255,255,255,.8); font-size: 12px; padding: 0 11px; white-space: nowrap; }
.shell-rb-tab:hover { color: #fff; background: rgba(255,255,255,.1); }
.shell-rb-tab.on { color: var(--primary); background:var(--surface); border-radius: 3px 3px 0 0; font-weight: 500; }
.shell-rb-groups { flex: 1; display: flex; align-items: stretch; overflow-x: auto; padding: 4px 6px 2px; }
.shell-rb-group { position: relative; display: flex; flex-direction: column; padding: 0 10px 13px; border-right: 1px solid rgba(255,255,255,.2); }
.shell-rb-group-name { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 9px; color: rgba(255,255,255,.7); }
.shell-rb-btns { display: flex; gap: 2px; align-items: flex-start; }
.shell-rb-btn { width: 56px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #fff; padding: 3px 3px; }
.shell-rb-btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.32); }
.shell-rb-ico { font-size: 19px; line-height: 21px; color: #fff; }
.shell-rb-lbl { font-size: 10px; line-height: 12px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: #fff; }

.shell-nav-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.shell-nav-q { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border: 1px solid transparent; border-radius: 5px; background: rgba(255,255,255,.04); color: #aab6c2; font-size: 10px; }
.shell-nav-q i { font-style: normal; font-size: 18px; line-height: 20px; }
.shell-nav-q:hover { background: rgba(255,255,255,.1); color: #fff; }
.shell-nav-q.on { background: rgba(var(--primary-rgb), .42); color: #fff; border-color: var(--primary); }
.shell-side-collapsed .shell-nav-quick { display: none; }
.shell-tabs { height: 34px; flex: none; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; gap: 1px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.shell-tabs::-webkit-scrollbar { height: 0; }
.shell-tab { display: flex; align-items: center; gap: 6px; height: 27px; border: 1px solid transparent; border-bottom: 0; border-radius: 5px 5px 0 0; background: transparent; color: var(--muted); font-size: 11px; padding: 0 8px 0 9px; white-space: nowrap; margin-bottom: -1px; }
.shell-tab:hover { color: var(--primary); background: var(--surface-2); }
.shell-tab.on { height: 31px; background:var(--surface); border-color: #B9C6D2; border-top: 2px solid var(--primary); color: var(--primary); font-weight: 500; box-shadow: 0 -1px 3px rgba(0,0,0,.05); }
.shell-tab-ico { font-style: normal; font-size: 12px; opacity: .75; }
.shell-tab-lbl { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.shell-tab i { font-style: normal; }
.shell-tab-star { font-size: 12px; color: #A8B4C0; line-height: 1; }
.shell-tab-star:hover { color: #BA7517; }
.shell-tab-star.on { color: #BA7517; }
.shell-tab-close { font-size: 14px; color: #9AA7B4; line-height: 1; width: 12px; text-align: center; }
.shell-tab-close:hover { color: #dc2626; }

.shell-favs { flex: none; border-top: 1px solid #263746; padding: 6px 8px 8px; max-height: 158px; overflow-y: auto; }
.shell-fav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px; font-size: 10px; letter-spacing: .5px; color: #7C8B99; }
.shell-fav-head button { border: 1px solid #3B5062; background: #1E2F3E; color: #9FC4E4; width: 18px; height: 16px; line-height: 14px; border-radius: 3px; padding: 0; font-size: 12px; }
.shell-fav-head button:hover { background: #2C6699; color: #fff; }
.shell-fav-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 4px; color: #B8C4D0; font-size: 11px; cursor: pointer; }
.shell-fav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.shell-fav-item i { font-style: normal; font-size: 12px; color: #6FA8D8; width: 14px; text-align: center; }
.shell-fav-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-fav-del { border: 0; background: transparent; color: #6C7B89; font-size: 13px; line-height: 1; padding: 0 2px; }
.shell-fav-del:hover { color: #ef6b6b; }
.shell-fav-empty { padding: 3px 6px; font-size: 10px; color: #5C6C7A; }
.shell-side-collapsed .shell-favs { display: none; }

table tbody tr:nth-child(even) td { background: var(--surface-2); }
table tbody tr:hover td { background: var(--primary-light); }
table tbody tr.selected td, table tbody tr:has(input[type="checkbox"]:checked) td { background: rgba(var(--primary-rgb), .14); }
table input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; vertical-align: middle; cursor: pointer; }
.vt-row.selected, .vt-row.selected.odd { background: rgba(var(--primary-rgb), .16) !important; }

.shell-dock { width: 250px; flex: none; border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.shell-dock-head { flex: none; border-bottom: 1px solid var(--line); display: flex; align-items: center; background: var(--surface-2); }
.shell-dock-tabs { display: flex; flex: 1; overflow-x: auto; scrollbar-width: none; }
.shell-dock-tabs::-webkit-scrollbar, .shell-rb-tabs::-webkit-scrollbar { height: 0; }
.shell-dock-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; padding: 9px 7px; white-space: nowrap; }
.shell-dock-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.shell-dock-close { border: 0; background: transparent; color: var(--muted); font-size: 16px; padding: 2px 8px; }
.shell-dock-body { flex: 1; overflow-y: auto; padding: 10px 12px; font-size: 12px; line-height: 1.6; }
.shell-dock-kicker { font-size: 10px; color: var(--muted); letter-spacing: .5px; margin-bottom: 4px; }
.shell-dock-title { font-size: 15px; font-weight: 500; color: var(--ink); }
.shell-dock-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.shell-dock-empty { color: var(--muted); font-size: 11px; padding: 18px 4px; text-align: center; line-height: 1.9; }
.shell-dock-step { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.shell-dock-step b { width: 18px; height: 18px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); border-radius: 2px; font-size: 10px; font-weight: 500; }
.shell-dock-step span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-dock-step em { font-style: normal; color: var(--muted); }
.shell-dock-step em.status-late { color: #B42318; }
.shell-dock-log { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--ink); }
.shell-dock-log span { display: block; color: var(--muted); font-size: 10px; }
.shell-dock-img { width: 100%; border: 1px solid var(--line); border-radius: 3px; }
.shell-progress { height: 6px; background: #E6ECF2; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.shell-progress i { display: block; height: 100%; background: var(--primary); }

.shell-status { height: 26px; background: #E9EEF4; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 14px; font-size: 11px; color: var(--muted); overflow: hidden; }
.shell-st-item { white-space: nowrap; }
.shell-st-user b, .shell-status b { color: var(--ink); font-weight: 500; }
.shell-st-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.shell-st-bad { color: #B42318; }

.shell-side-collapsed .app { grid-template-columns: 52px minmax(0,1fr); }
.shell-side-collapsed .shell-rb-head { width: 52px; }
.shell-side-collapsed .shell-rb-mark, .shell-side-collapsed .shell-rb-title,
.shell-side-collapsed .shell-rb-qat { display: none; }
.shell-side-collapsed .shell-rb-id { justify-content: center; padding: 0 6px; }
.shell-side-collapsed .sidebar .brand-info, .shell-side-collapsed .sidebar .quota-bar,
.shell-side-collapsed .sidebar .sync-bar, .shell-side-collapsed .sidebar .sidebar-foot,
.shell-side-collapsed .sidebar .nav-group, .shell-side-collapsed .sidebar .nav-badge,
.shell-side-collapsed .sidebar .nav-item span:not(.nav-icon) { display: none; }
.shell-side-collapsed .sidebar .brand { justify-content: center; padding: 12px 6px; }
.shell-side-collapsed .sidebar .nav-item { justify-content: center; margin: 2px 6px; }
.shell-dock-hidden .shell-dock { display: none; }

/* 状态色：全厂统一五档，禁止渐变与彩色卡片 */
.tag-blue { background: #E8F1F9; color: var(--primary); }
.tag-green { background: #E7F4EA; color: #1F7A3D; }
.tag-orange, .tag-yellow { background: #FFF3D6; color: #9A6100; }
.tag-red { background: #FCEAEA; color: #B42318; }
.tag-gray { background: #EEF1F4; color: #5A6672; }
.tag-purple { background: #F0E9FC; color: #6D28D9; }

/* 清理全部渐变、阴影与毛玻璃，保证强光与老旧屏幕可读 */
.login-bg, .login-bg::after, .login-page::after, .login-box, .quota-bar, .quota-bar:hover,
.board-greet, .peek-file-icon, .sidebar, .brand-logo, .nav-item.active, .avatar,
.mobile-head, .m-hero, .dash-titlebar, .dash-body, .m-task-bar i, .m-avatar,
.doc-table th, .shift-block.ot, .wi-pc-bar i {
  background-image: none !important; box-shadow: none !important; backdrop-filter: none !important;
}
.login-bg { background: #0F161E !important; }
.login-box { background: #fff !important; border: 1px solid var(--line); }
.quota-bar { background: #1D2C3A !important; }
.quota-bar:hover { background: #25394C !important; }
.board-greet, .dash-titlebar { background: #EEF3F8 !important; }
.peek-file-icon { background: #E9EFF5 !important; color: var(--primary) !important; }
.sidebar { background: var(--sidebar-bg, #16202A) !important; }
.brand-logo, .avatar, .m-avatar, .mobile-head, .m-hero, .m-task-bar i, .wi-pc-bar i, .doc-table th { background: #0A3D6B !important; }
.nav-item.active { background: var(--sidebar-active-bg, #12395C) !important; border-left-color: #6FA8D8 !important; }
.dash-body { background: var(--canvas) !important; }
.doc-table th { border-color: #062B4C !important; color: #fff !important; }
.shift-block.ot { background: #9A6100 !important; }
.card, .stat-card, .topbar { box-shadow: none !important; }
.stat-card, .card { transition: none !important; }
.stat-card:hover { transform: none !important; box-shadow: none !important; }

/* ===== v1.9.2 布局疏解：还中间数据区以宽度 ===== */
.app { grid-template-columns: 196px minmax(0, 1fr); }
.shell-side-collapsed .app { grid-template-columns: 52px minmax(0, 1fr); }

.shell-ribbon { min-height: 86px; }
.shell-rb-head { width: 176px; flex-direction: row; align-items: center; gap: 7px; padding: 0 10px; }
.shell-rb-tabs { height: 30px; }
.shell-rb-qat { margin-left: auto; display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.shell-rb-qat button { width: 22px; height: 19px; font-size: 10px; }
.shell-rb-groups { padding: 3px 6px 2px; }
.shell-rb-group { padding: 0 8px 11px; }
.shell-rb-btn { width: 56px; min-height: 40px; gap: 2px; padding: 2px 2px; }
.shell-rb-ico { font-size: 17px; line-height: 18px; }
.shell-rb-lbl { font-size: 10px; line-height: 11px; }

.shell-main-body { position: relative; }
.shell-dock {
  position: absolute; top: 0; right: 0; bottom: 0; width: 300px; z-index: 30;
  transform: translateX(0); transition: transform .18s ease;
  box-shadow: -6px 0 18px rgba(15,30,45,.16);
}
.shell-dock-hidden .shell-dock { transform: translateX(100%); pointer-events: none; }

.topbar { height: 40px; padding: 0 16px; }
.crumb { font-size: 14px; }
.card-head { padding: 10px 16px; }

.sidebar .brand { padding: 10px 12px; gap: 8px; }
.brand-logo { width: 30px; height: 28px; border-radius: 6px; font-size: 11px; }
.brand-info b { font-size: 12px; }
.brand-info span { font-size: 10px; }
.quota-bar, .sync-bar { margin: 5px 8px; padding: 5px 8px; font-size: 10px; border-radius: 4px; }
.shell-nav-quick { grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 5px; }
.shell-nav-q { padding: 4px 2px; gap: 1px; font-size: 9px; }
.shell-nav-q i { font-size: 15px; line-height: 16px; }
.nav { padding: 4px 0; }
.nav-group { padding: 7px 14px 3px; font-size: 10px; }
.nav-item { padding: 6px 14px; font-size: 12px; }
.update-tip { display: none; }
.sidebar-foot { padding: 8px 10px; }
.btn-logout { padding: 5px; }

@media (max-width: 1100px) {
  .shell-dock { width: min(320px, 88vw); }
}

/* ==========================================================================
   客户自选皮肤 v1.9.6
   预设只覆盖设计令牌；深色模式额外覆盖背景/文字；个人偏好由 js/theme.js 管理。
   ========================================================================== */
html { zoom: var(--ui-zoom, 1); }
:root[data-theme="ocean"] {
  --primary: #0a3d6b; --primary-rgb: 10,61,107; --primary-dark: #062b4c; --primary-light: #e8f0f7; --primary-ink: #062a47;
  --accent: #0e8a9a; --accent-rgb: 14,138,154;
  --sidebar: #0f2740; --sidebar-hover: #17395c; --graphite: #0f2740; --graphite-2: #17395c; --graphite-3: #214868;
}
:root[data-theme="indigo"] {
  --primary: #0a4a9c; --primary-rgb: 10,74,156; --primary-dark: #073a7a; --primary-light: #e9f1fb; --primary-ink: #07366e;
  --accent: #0e8a9a; --accent-rgb: 14,138,154;
  --sidebar: #12294a; --sidebar-hover: #1a3a63; --graphite: #12294a; --graphite-2: #1a3a63; --graphite-3: #234b7e;
}
:root[data-theme="steel"] {
  --primary: #3e5a73; --primary-rgb: 62,90,115; --primary-dark: #2f465a; --primary-light: #edf1f5; --primary-ink: #2b4050;
  --accent: #0e8a9a; --accent-rgb: 14,138,154;
  --sidebar: #1e2a33; --sidebar-hover: #2b3a46; --graphite: #1e2a33; --graphite-2: #2b3a46; --graphite-3: #3a4c5b;
}
:root[data-theme="green"] {
  --primary: #2f7d5b; --primary-rgb: 47,125,91; --primary-dark: #236247; --primary-light: #e8f4ee; --primary-ink: #1c523b;
  --accent: #b07d2b; --accent-rgb: 176,125,43;
  --sidebar: #16251e; --sidebar-hover: #213a2f; --graphite: #16251e; --graphite-2: #213a2f; --graphite-3: #2c4d3e;
}
:root[data-theme="amber"] {
  --primary: #b8631e; --primary-rgb: 184,99,30; --primary-dark: #934c14; --primary-light: #fdf0e4; --primary-ink: #854311;
  --accent: #2c6f9e; --accent-rgb: 44,111,158;
  --sidebar: #2a1e16; --sidebar-hover: #3d2b1e; --graphite: #2a1e16; --graphite-2: #3d2b1e; --graphite-3: #523b29;
}
:root[data-theme="slate"] {
  --primary: #4a5b6d; --primary-rgb: 74,91,109; --primary-dark: #374656; --primary-light: #edf0f3; --primary-ink: #2e3a46;
  --accent: #8a6a3b; --accent-rgb: 138,106,59;
  --sidebar: #20262c; --sidebar-hover: #2e3740; --graphite: #20262c; --graphite-2: #2e3740; --graphite-3: #3c4752;
}
:root[data-theme="purple"] {
  --primary: #66509e; --primary-rgb: 102,80,158; --primary-dark: #4f3c80; --primary-light: #f0ecfa; --primary-ink: #46336f;
  --accent: #2f7d8e; --accent-rgb: 47,125,142;
  --sidebar: #1e1a2b; --sidebar-hover: #2d2740; --graphite: #1e1a2b; --graphite-2: #2d2740; --graphite-3: #3d3556;
}

/* 深色模式：背景与文字整体反转，主色保持各皮肤原值，按钮白字仍可读 */
:root[data-mode="dark"] {
  --surface: #18212b; --surface-2: #202b36; --canvas: #101820;
  --ink: #e8eef4; --ink-2: #c8d4de; --muted: #98a8b6; --faint: #708393;
  --line: #2b3945; --line-soft: #23303b;
  --text: #e8eef4; --text-muted: #98a8b6; --border: #2b3945; --bg: #101820; --card: #18212b;
  --sidebar: #0b1219; --sidebar-hover: #1a2732;
  --primary-light: rgba(var(--primary-rgb), .18);
  --success-light: rgba(63,135,98,.18); --warning-light: rgba(192,128,46,.18); --danger-light: rgba(184,84,80,.18);
  --shadow: 0 1px 3px rgba(0,0,0,.45); --shadow-1: 0 1px 3px rgba(0,0,0,.4);
  --shadow-2: 0 4px 14px rgba(0,0,0,.45); --shadow-3: 0 18px 48px rgba(0,0,0,.6);
}
:root[data-mode="dark"] body { background: var(--canvas); }
:root[data-mode="dark"] .topbar,
:root[data-mode="dark"] .shell-tabs,
:root[data-mode="dark"] .shell-status,
:root[data-mode="dark"] .modal,
:root[data-mode="dark"] .dash-kpi,
:root[data-mode="dark"] .dash-mini,
:root[data-mode="dark"] .dash-board .dash-panel,
:root[data-mode="dark"] .dash-goal,
:root[data-mode="dark"] .m-order,
:root[data-mode="dark"] .m-task-card,
:root[data-mode="dark"] .m-me-card,
:root[data-mode="dark"] .m-me-list,
:root[data-mode="dark"] .m-empty,
:root[data-mode="dark"] .check-item { background: var(--surface); }
:root[data-mode="dark"] .dash-body { background: var(--canvas); }
:root[data-mode="dark"] .btn { background: var(--surface-2); }
:root[data-mode="dark"] .btn-primary,
:root[data-mode="dark"] .btn-success,
:root[data-mode="dark"] .btn-danger { color: #fff; }
:root[data-mode="dark"] .stat-card.blue .value,
:root[data-mode="dark"] .m-kpi b,
:root[data-mode="dark"] .m-qi.blue,
:root[data-mode="dark"] .m-tip { color: #8fc4ea; }
:root[data-mode="dark"] .board-greet,
:root[data-mode="dark"] .dash-titlebar { background: linear-gradient(100deg, var(--primary-light), var(--surface)); }
:root[data-mode="dark"] .login-box { background: var(--surface); color: var(--ink); }
:root[data-mode="dark"] .login-box input { background: var(--surface-2); color: var(--ink); }
:root[data-mode="dark"] table th { background: var(--surface-2); }
:root[data-mode="dark"] ::-webkit-scrollbar-thumb { background: #3a4a58; }

/* 紧凑间距：表格/卡片一屏显示更多行 */
:root[data-density="compact"] .page { padding: 12px 16px 24px; }
:root[data-density="compact"] .card-body { padding: 10px 14px; }
:root[data-density="compact"] .card-head { padding: 8px 14px; }
:root[data-density="compact"] th,
:root[data-density="compact"] td { padding: 5px 8px; }
:root[data-density="compact"] .nav-item { padding-top: 5px; padding-bottom: 5px; }
:root[data-density="compact"] .stat-card { padding: 10px 12px; }
:root[data-density="compact"] .dash-body { padding: 12px 14px; }

/* ---------- 皮肤面板 ---------- */
.skin-btn { width: auto; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--primary); border-color: var(--primary); }
.skin-btn:hover { background: var(--primary-light); }
.theme-panel-mask { position: fixed; inset: 0; z-index: 9000; background: rgba(8,14,20,.42); }
.theme-panel {
  position: fixed; z-index: 9001; right: 0; top: 0; bottom: 0; width: min(430px, 94vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; animation: theme-slide .22s var(--ease) both;
}
@keyframes theme-slide { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.theme-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, var(--primary-light), var(--surface)); }
.theme-panel-head div { display: flex; flex-direction: column; }
.theme-panel-head b { font-size: 17px; color: var(--ink); }
.theme-panel-head span { font-size: 12px; color: var(--muted); }
.theme-panel-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.theme-sec-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; margin: 6px 0 10px; }
.theme-sec-title:not(:first-child) { margin-top: 22px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-card {
  position: relative; display: flex; flex-direction: column; gap: 5px; text-align: left;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.theme-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.theme-card.on { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .14); }
.theme-card b { font-size: 13px; color: var(--ink); }
.theme-card small { font-size: 11px; color: var(--muted); }
.theme-card em { position: absolute; right: 8px; top: 8px; font-style: normal; font-size: 10px; color: #fff; background: var(--primary); border-radius: 8px; padding: 1px 7px; }
.theme-swatch { display: flex; align-items: flex-end; gap: 3px; height: 34px; padding: 5px; border-radius: 6px; }
.theme-swatch i { display: block; height: 10px; width: 16px; border-radius: 2px; }
.theme-swatch i:first-child { height: 22px; width: 26px; }
.theme-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.theme-opt { padding: 7px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-2); font-size: 12px; }
.theme-opt:hover { border-color: var(--primary); }
.theme-opt.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.theme-custom { display: flex; gap: 8px; align-items: center; }
.theme-custom input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.theme-custom input[type="text"] { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.sidebar-opt i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(255,255,255,.28); }
.theme-panel-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.theme-panel-foot .btn { flex: 1; padding-left: 6px; padding-right: 6px; }

/* ---------- 快速上手清单折叠 ---------- */
.checklist-fold { margin-left: 12px; flex: none; }
.checklist-body { transition: opacity .15s; }

/* ==========================================================================
   全员操作广播消息中心 v1.9.7
   浮层层级规范：内容 0-9 / 页签 10 / 顶栏 20 / 抽屉 30 / 弹窗 100 /
   消息面板 8000 / 皮肤面板 9000 / 提示 9500 / 文件预览 9999 / 右键菜单 60000
   ========================================================================== */
.msg-btn { position: relative; width: auto; padding: 0 10px; font-size: 14px; }
.msg-badge {
  position: absolute; top: -7px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.msg-panel-mask { position: fixed; inset: 0; z-index: 8000; background: rgba(8,14,20,.32); }
.msg-panel {
  position: fixed; z-index: 8001; right: 0; top: 0; bottom: 0; width: min(420px, 94vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; animation: theme-slide .22s var(--ease) both;
}
.msg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, var(--primary-light), var(--surface)); }
.msg-panel-head div { display: flex; flex-direction: column; }
.msg-panel-head b { font-size: 16px; color: var(--ink); }
.msg-panel-head span { font-size: 11px; color: var(--muted); }
.msg-panel-tools { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.msg-list { flex: 1; overflow-y: auto; padding: 4px 12px; }
.msg-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.msg-item:hover { background: var(--surface-2); }
.msg-item.unread { background: var(--primary-light); }
.msg-avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.msg-main { flex: 1; min-width: 0; }
.msg-line { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.msg-line b { color: var(--ink); }
.msg-line time { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.msg-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--danger); }
.msg-tag { padding: 0 6px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.msg-item.unread .msg-tag { background: var(--primary); color: #fff; }
.msg-tag.t-审批 { background: #fef3c7; color: #92400e; }
.msg-tag.t-异常 { background: #fee2e2; color: #b91c1c; }
.msg-tag.t-提醒 { background: #dbeafe; color: #1d4ed8; }
.msg-aud { padding: 0 5px; border-radius: 8px; background: #F0E9FC; color: #6D28D9; font-size: 10px; font-weight: 600; flex: none; }
.msg-text { margin-top: 3px; font-size: 12px; line-height: 1.55; color: var(--ink-2); word-break: break-all; }
.msg-read { border: 0; background: transparent; color: var(--primary); font-size: 11px; padding: 2px 4px; flex: none; }
.msg-del { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 2px 4px; flex: none; cursor: pointer; }
.msg-del:hover { color: var(--danger); }
.msg-del.disabled { color: var(--muted-2, #c3c8d0); cursor: not-allowed; opacity: .55; }
.msg-del.disabled:hover { color: var(--muted-2, #c3c8d0); }
.msg-page-list { padding: 4px 16px 14px; }
.msg-page-list .msg-item { padding: 12px 8px; }
.msg-empty { padding: 36px 12px; text-align: center; color: var(--muted); font-size: 13px; }

/* ==========================================================================
   可访问性增强 v1.9.21：键盘焦点环 + 禁用态灰化
   车间常戴手套/少用鼠标，键盘可达性与状态可见性是硬需求。
   ========================================================================== */

/* —— 焦点可见性：所有可交互元素统一 2px 焦点环（2px 偏移，键盘触达才显示）—— */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
/* 输入框已有边框高亮，焦点环改为描边色，避免双重边框重叠 */
.form-item input:focus-visible,
.form-item select:focus-visible,
.form-item textarea:focus-visible,
.login-box input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 0;
}
/* 侧边栏导航项焦点：左对齐高亮，贴合导航造型 */
.nav-item:focus-visible { outline-offset: -2px; }
/* 甘特条 / 卡片等可拖拽、可点击的块级元素 */
.gantt-bar:focus-visible, .op-card:focus-visible, .check-item:focus-visible {
  outline-offset: 1px;
}

/* —— 禁用态：统一灰化 + 禁止交互 + 明确鼠标提示 —— */
button:disabled, .btn:disabled, input:disabled, select:disabled, textarea:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: auto;
  box-shadow: none;
}
/* 主按钮禁用时去掉主色投影，仅灰化，避免「灰的按钮还发光」的误导 */
.btn-primary:disabled { box-shadow: none; background: var(--primary); }
/* 岗位职责外的录入入口（duty-locked）保持原有灰白禁用风格，仅补齐焦点环 */
.duty-locked:disabled, .duty-locked {
  opacity: .5;
  cursor: not-allowed;
}
/* 深色模式下禁用态对比度补偿：调低不透明度即可，文字仍可辨认 */
:root[data-mode="dark"] button:disabled,
:root[data-mode="dark"] input:disabled,
:root[data-mode="dark"] select:disabled,
:root[data-mode="dark"] textarea:disabled { opacity: .4; }

/* —— 骨架屏：数据加载占位，shimmer 微光扫过，替代「白屏等数据」—— */
.skeleton { position: relative; overflow: hidden; background: var(--line-soft); border-radius: 6px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 13px; margin: 10px 0; }
.skeleton-title { height: 17px; width: 34%; margin-bottom: 14px; }
.skeleton-para { height: 12px; width: 82%; }
.skeleton-para.short { width: 58%; }
:root[data-mode="dark"] .skeleton { background: var(--surface-2); }
:root[data-mode="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* ==========================================================================
   响应式断点系统化 v1.9.23
   主壳已有「手动折叠」机制（body.shell-side-collapsed，点 ☰ 收缩按钮触发）。
   窄窗口场景下自动复用同一套折叠视觉，避免窄屏侧栏挤压主内容区；
   触屏断点下顶栏图标按钮放大到 44px 触摸目标。
   ========================================================================== */

/* 中等断点（平板横屏/窄窗口）：自动折叠侧栏，复用手动折叠的同款规则 */
@media (max-width: 1100px) {
  .app { grid-template-columns: 52px minmax(0, 1fr); }
  .shell-rb-head { width: 52px; }
  .shell-rb-mark, .shell-rb-title, .shell-rb-qat { display: none; }
  .sidebar .brand-info, .sidebar .quota-bar, .sidebar .sync-bar, .sidebar .sidebar-foot,
  .sidebar .nav-group, .sidebar .nav-badge, .sidebar .nav-item span:not(.nav-icon) { display: none; }
  .sidebar .brand { justify-content: center; padding: 12px 6px; }
  .sidebar .nav-item { justify-content: center; margin: 2px 6px; }
}

/* 触屏断点：顶栏图标按钮触摸目标放大到 44px，减少误触 */
@media (max-width: 760px) and (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; border-radius: 8px; }
  .icon-btn svg.ico { width: 20px; height: 20px; }
  .top-actions { gap: 6px; }
}

