/* ============================================================
   关澜ERP v2 · 设计系统
   对齐 Ardot「v2 源码对齐版」七屏：
   背景 #FAFAFA / 卡片 #FFFFFF / 主文本 #0A0A0B / 次文本 #52525B
   边框 #E4E4E7 / 强调 #3B82F6 / 成功 #10B981 / 警告 #F59E0B / 错误 #EF4444
   圆角：卡片 8 / 按钮 6
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F4F5F9;
  --card: #FFFFFF;
  --card-2: #FCFCFD;
  --fill: #F4F4F5;
  --text: #101828;
  --muted: #5D6B85;
  --sub: #98A2B3;
  --line: #EBEDF2;
  --line-soft: #F1F3F7;
  --primary: #5B5BD6;
  --primary-d: #4A4AC9;
  --primary-soft: #EEEEFC;
  --primary-line: #C9C9F2;
  --ok: #069949;
  --ok-soft: #E9F7EF;
  --warn: #C47D0A;
  --warn-soft: #FBF3E2;
  --danger: #D92D20;
  --danger-soft: #FEECEB;
  --purple: #7C3AED;
  --purple-soft: #F5F3FF;
  --radius: 12px;
  --radius-btn: 8px;
  --sidebar-w: 210px;
  --topbar-h: 56px;
  --crumb-h: 38px;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-pop: 0 12px 32px -8px rgba(16,24,40,.16);
}

html, body { height: 100%; }
body {
  font-family: "Inter", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.num { font-family: "Inter", "Noto Sans SC", sans-serif; font-variant-numeric: tabular-nums; }
a { color: var(--primary); text-decoration: none; }

/* ============ 登录（2026-11-05 重设计：左科技内容 + 右登录） ============ */
.login-wrap { position: fixed; inset: 0; display: flex; align-items: stretch; justify-content: stretch; }

/* ---- 左侧内容区 ---- */
.login-left {
  position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7vh 5.5vw;
  background:
    radial-gradient(1100px 720px at 72% 12%, rgba(37,99,235,.34) 0%, rgba(37,99,235,0) 62%),
    radial-gradient(900px 640px at 8% 92%, rgba(34,211,238,.14) 0%, rgba(34,211,238,0) 58%),
    linear-gradient(152deg, #071127 0%, #0B1B3A 48%, #060D1F 100%);
  color: #E6EEFF;
}
/* 蓝图网格 */
.ll-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(59,130,246,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.13) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 100% at 60% 40%, #000 40%, transparent 100%);
          mask-image: radial-gradient(120% 100% at 60% 40%, #000 40%, transparent 100%);
}
/* 扫描光带 */
.ll-scan {
  position: absolute; left: 0; right: 0; height: 140px; pointer-events: none;
  background: linear-gradient(180deg, rgba(59,130,246,0) 0%, rgba(59,130,246,.07) 55%, rgba(34,211,238,.12) 82%, rgba(34,211,238,0) 100%);
  animation: llscan 7.5s linear infinite;
}
@keyframes llscan { 0% { top: -140px; } 100% { top: 100%; } }
/* 漂浮粒子 */
.ll-particles { position: absolute; inset: 0; pointer-events: none; }
.ll-particles i {
  position: absolute; bottom: -6px; width: 4px; height: 4px; border-radius: 50%;
  background: rgba(96,165,250,.55); box-shadow: 0 0 8px rgba(96,165,250,.6);
  animation: llrise 11s linear infinite;
}
.ll-particles i:nth-child(1) { left: 8%;  animation-delay: 0s;   transform: scale(.8); }
.ll-particles i:nth-child(2) { left: 20%; animation-delay: 2.4s; }
.ll-particles i:nth-child(3) { left: 33%; animation-delay: 5.1s; transform: scale(.6); }
.ll-particles i:nth-child(4) { left: 46%; animation-delay: 1.2s; }
.ll-particles i:nth-child(5) { left: 60%; animation-delay: 6.3s; transform: scale(.7); }
.ll-particles i:nth-child(6) { left: 73%; animation-delay: 3.6s; }
.ll-particles i:nth-child(7) { left: 86%; animation-delay: 7.8s; transform: scale(.6); }
.ll-particles i:nth-child(8) { left: 94%; animation-delay: 4.5s; transform: scale(.9); }
@keyframes llrise {
  0%   { transform: translateY(0);      opacity: 0; }
  8%   { opacity: .9; }
  85%  { opacity: .5; }
  100% { transform: translateY(-96vh);  opacity: 0; }
}
/* 装配式蓝图 SVG */
.ll-house {
  position: absolute; right: -30px; bottom: 30px; width: min(58%, 620px);
  opacity: .85; pointer-events: none;
}
.bp-line { stroke: #60A5FA; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: bpdraw 2.4s ease forwards; }
.bp-s1 { animation-delay: .15s; } .bp-s2 { animation-delay: .3s; }
.bp-s3 { animation-delay: .45s; } .bp-r  { animation-delay: .6s; }
.bp-dim { stroke: #22D3EE; stroke-width: 1; stroke-dasharray: 6 5; animation: bpfade 1.2s ease 1.4s forwards; opacity: 0; }
.bp-fill { fill: rgba(59,130,246,.08); }
.bp-txt { fill: rgba(147,197,253,.75); font-size: 12px; font-family: "Inter","Noto Sans SC",sans-serif; letter-spacing: 1px; opacity: 0; animation: bpfade 1s ease 1.7s forwards; }
.bp-txt-c { fill: rgba(34,211,238,.85); }
.bp-node { fill: #22D3EE; opacity: 0; animation: nodepulse 2.6s ease-in-out 1.8s infinite; }
.bp-scan { fill: rgba(34,211,238,.10); stroke: rgba(34,211,238,.4); stroke-width: 1;
  opacity: 0; animation: scanhi 4.5s ease-in-out 2s infinite; }
@keyframes bpdraw { to { stroke-dashoffset: 0; } }
@keyframes bpfade { to { opacity: 1; } }
@keyframes nodepulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes scanhi { 0%, 100% { opacity: 0; } 18%, 60% { opacity: 1; } }

/* 左侧文案 */
.ll-content { position: relative; z-index: 2; max-width: 640px; }
.ll-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.ll-mark {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #3B82F6, #22D3EE);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800; color: #fff;
  box-shadow: 0 6px 22px rgba(59,130,246,.45);
}
.ll-name { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.ll-erp { color: #60A5FA; margin-left: 2px; }
.ll-title { font-size: clamp(28px, 3.2vw, 44px); font-weight: 800; line-height: 1.28; letter-spacing: 1px; }
.ll-title span {
  display: block; margin-top: 6px;
  background: linear-gradient(92deg, #60A5FA 0%, #22D3EE 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ll-desc { margin-top: 20px; font-size: 14.5px; line-height: 1.9; color: rgba(230,238,255,.62); }
.ll-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.ll-tags span {
  padding: 6px 16px; border-radius: 999px; font-size: 13px; letter-spacing: 2px;
  color: #9EC5FF; border: 1px solid rgba(96,165,250,.4); background: rgba(59,130,246,.12);
}
.ll-stats { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 42px; }
.ll-stat b { display: block; font-size: 30px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.ll-stat i { font-style: normal; font-size: 12.5px; color: rgba(230,238,255,.55); letter-spacing: 1px; }
.ll-foot { position: absolute; left: 5.5vw; bottom: 26px; font-size: 12px; letter-spacing: 1.5px; color: rgba(230,238,255,.35); z-index: 2; }

/* ---- 右侧登录表单 ---- */
.login-right {
  flex: 0 0 440px; position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: #FFFFFF; padding: 40px 44px;
  box-shadow: -18px 0 60px rgba(3,10,30,.45);
}
.login-box { width: 100%; max-width: 316px; }
.login-brand { font-size: 27px; font-weight: 800; letter-spacing: .5px; }
.login-brand span { color: var(--primary); }
.login-sub { color: var(--muted); margin: 7px 0 30px; font-size: 12.5px; letter-spacing: 1px; }
.login-input { width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-btn); font-size: 14px; font-family: inherit; background: #FAFAFA; }
.login-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.login-btn { width: 100%; padding: 12px; background: linear-gradient(92deg, var(--primary) 0%, #22D3EE 130%); color: #fff; border: none; border-radius: var(--radius-btn); font-size: 14.5px; font-weight: 600; cursor: pointer; transition: filter .15s; }
.login-btn:hover { filter: brightness(1.06); }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-msg { color: var(--danger); text-align: center; margin-top: 11px; min-height: 18px; font-size: 12.5px; }

/* ---- 登录页响应式 ---- */
@media (max-width: 960px) {
  .login-left { display: none; }
  .login-right { flex: 1 1 100%; width: 100%; min-width: 0; box-shadow: none; background: linear-gradient(160deg, #0B1B3A 0%, #14336B 100%); padding: 32px 22px; }
  .login-box { max-width: 380px; width: 100%; margin: 0 auto; background: #fff; border-radius: 14px; padding: 32px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
}
@media (max-width: 380px) {
  .login-right { padding: 24px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .ll-scan, .ll-particles i, .bp-line, .bp-dim, .bp-txt, .bp-node, .bp-scan { animation: none !important; opacity: 1; stroke-dashoffset: 0; }
}
.login-msg { color: var(--danger); text-align: center; margin-top: 11px; min-height: 18px; font-size: 12.5px; }

/* ============ 布局 ============ */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--line-soft); }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.menu { flex: 1; overflow-y: auto; padding: 12px 0 20px; }
.menu-group { padding: 14px 16px 5px; font-size: 11px; color: var(--sub); font-weight: 500; letter-spacing: .3px; }
.menu-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px; cursor: pointer;
  color: var(--muted); font-size: 13.5px; border-left: 2px solid transparent; user-select: none;
}
.menu-item:hover { background: var(--bg); color: var(--text); }
.menu-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; border-left-color: var(--primary); }
.menu-icon { width: 17px; text-align: center; font-size: 13.5px; opacity: .85; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.sf-line { font-size: 11px; color: var(--muted); }
.sf-line.dim { color: var(--sub); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h); background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 18px; flex-shrink: 0;
}
.menu-btn { display: none; font-size: 18px; background: none; border: none; cursor: pointer; color: var(--text); }
.page-title { font-size: 14px; color: var(--muted); font-weight: 500; }
.topbar-search { position: relative; margin-left: auto; }
.ts-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--sub); font-size: 13px; }
.topbar-search input { width: 250px; padding: 6px 10px 6px 26px; border: 1px solid var(--line); border-radius: var(--radius-btn); font-size: 12.5px; font-family: inherit; background: var(--bg); }
.topbar-search input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.icon-btn { position: relative; background: none; border: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 4px 6px; border-radius: var(--radius-btn); }
.icon-btn:hover { background: var(--bg); }
.bell-dot { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
/* 会员待办未读数（2026-10-29）—— 复用 bell-dot 定位，尺寸变角标 */
.bell-dot.bell-count {
  top: -4px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  width: auto; border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px;
  text-align: center; letter-spacing: 0;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; }
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11.5px; background: var(--primary-soft); color: var(--primary); padding: 2px 9px; border-radius: 20px; }

.content { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }

/* ============ 页头 ============ */
.page-head { margin-bottom: 18px; position: relative; }
.page-title-lg { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.page-sub b { color: var(--text); font-weight: 600; }
/* 第 24 轮：页头右上角操作区（设计/生产管理页的「新建耗材 / 采购申请」入口） */
.page-act { position: absolute; right: 0; top: 0; display: flex; align-items: center; gap: 8px; }
.page-act .btn { white-space: nowrap; }
/* ★ 2026-11-06：无页头屏的全站常驻新建按钮操作条 */
.qc-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }

/* ============ 卡片 ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.card-title { font-size: 13.5px; font-weight: 600; }
.card-body { padding: 16px; }
.card-link { margin-left: auto; font-size: 12.5px; color: var(--primary); cursor: pointer; }
.card-link:hover { text-decoration: underline; }

/* ============ KPI ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 25px; font-weight: 700; margin: 6px 0 5px; letter-spacing: -.5px; }
.kpi-note { font-size: 11.5px; color: var(--sub); }
.kpi-note.up { color: var(--ok); }
.kpi-note.warn { color: var(--warn); }
.kpi-note.danger { color: var(--danger); }

/* ============ 三栏 / 两栏 ============ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2-32 { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 14px; align-items: start; }

/* ============ 第 9 轮 · 四档看板 ============ */
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.dash-row { margin-top: 14px; }
.dash-row .card + .card { margin-top: 0; }
.dash-row > .card { margin-top: 0; }

/* admin 科技感 hero */
.dash-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 26px; margin-bottom: 16px; border-radius: 14px;
  /* 墨青深色：比原来的纯蓝黑更沉稳，光晕收敛为左上青 + 右下靛 */
  background:
    radial-gradient(1000px 260px at 4% -60%, rgba(45,212,191,.16), transparent 62%),
    radial-gradient(820px 300px at 102% -60%, rgba(99,102,241,.20), transparent 64%),
    linear-gradient(135deg, #0E1A24 0%, #0A1520 52%, #101C2B 100%);
  color: #E8EEF6; position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.dash-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(148,180,210,.07) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148,180,210,.07) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: linear-gradient(180deg, rgba(0,0,0,.42), transparent 80%);
}
.dash-hero-l { position: relative; z-index: 1; min-width: 0; }
/* 标题：26px / 真粗体
   字体优先用「微软雅黑」—— 它有独立的 Bold 字重文件（msyhbd.ttc），
   渲染出的粗体是真正的黑度；Noto Sans SC 是可变字体，800 权重在部分
   浏览器里会被渲染成细字重，所以放在雅黑之后兜底。
   不用 text-shadow 模拟粗体 —— 描边会让中文笔画边缘发毛。 */
.dash-hero .page-title-lg {
  color: #FFFFFF; font-size: 26px; font-weight: 700;
  letter-spacing: 1.5px; line-height: 1.25;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* 副标题：提亮 + 加大字距，避免小字糊在深底上 */
.dash-hero .page-sub {
  color: #A7B8CC; font-size: 13px; line-height: 1.7;
  letter-spacing: .3px; margin-top: 8px;
}
.dash-hero .page-sub b { color: #DCE7F3; font-weight: 700; }
.dash-hero-r { position: relative; z-index: 1; }
.dash-ring { display: flex; align-items: center; gap: 14px; }
.dash-ring svg { display: block; }

/* SVG 图形容器 */
.viz { display: block; max-width: 100%; }
.dwrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dlegend { flex: 1; min-width: 160px; }
.dlegend-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12.5px; }
.dlegend-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.dlegend-name { color: var(--muted); }
.dlegend-val { margin-left: auto; font-weight: 700; }
.dlegend-pct { width: 52px; text-align: right; color: var(--sub); font-size: 11.5px; }

/* 小统计行 */
.mini-stat { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; color: var(--muted); }
.mini-stat:last-of-type { border-bottom: none; }
.mini-stat b { font-size: 17px; font-weight: 700; color: var(--text); }
.sub-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

/* 受阻 / 超期列表 */
.blist-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
.blist-row:last-child { border-bottom: none; }
.blist-id { color: var(--sub); font-weight: 700; flex: none; }
.blist-no { color: var(--primary); font-weight: 600; flex: none; }
.blist-pd { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blist-tag { color: var(--warn); font-size: 11.5px; flex: none; }

/* 16 步流程热力 */
.heat { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.heat-cell { border: 1px solid var(--line); border-radius: 9px; padding: 9px 9px 8px; background: #FBFCFE; }
.heat-ic { font-size: 15px; line-height: 1; }
.heat-nm { font-size: 11px; color: var(--muted); margin: 5px 0 6px; height: 26px; line-height: 1.3; overflow: hidden; }
.heat-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; display: flex; }
.heat-bar > i.ok { background: var(--ok); }
.heat-bar > i.now { background: var(--primary); }
.heat-vl { font-size: 10.5px; color: var(--sub); margin-top: 4px; font-weight: 600; }

@media (max-width: 1280px) {
  .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .heat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .kpi-grid-4, .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .heat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============ 分布条 ============ */
.dist-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.dist-label { width: 58px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.dist-track { flex: 1; height: 10px; background: var(--fill); border-radius: 5px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 5px; background: var(--primary); }
.dist-fill.ok { background: var(--ok); }
.dist-val { width: 34px; text-align: right; font-weight: 600; font-size: 12.5px; }

/* ============ 待办 ============ */
.todo-item { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 13px; }
.todo-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.todo-count { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ 库存预警 ============ */
.stock-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.stock-name { width: 78px; color: var(--muted); flex-shrink: 0; }
.stock-bar { flex: 1; height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; }
.stock-fill { height: 100%; background: var(--ok); border-radius: 3px; }
.stock-fill.low { background: var(--danger); }
.stock-val { font-size: 11.5px; color: var(--danger); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; font-size: 12.5px; }
th { background: var(--bg); color: var(--muted); font-weight: 500; font-size: 12px; }
tbody tr:hover td { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }
.td-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.td-sub { font-size: 11px; color: var(--sub); font-weight: 400; }
.td-order-no { color: var(--primary); font-weight: 500; cursor: pointer; }
.td-order-no:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--sub); padding: 44px 20px; font-size: 13px; }
.empty-icon { font-size: 26px; opacity: .35; display: block; margin-bottom: 8px; }

/* ============ 徽标 ============ */
.badge { display: inline-block; padding: 1.5px 9px; border-radius: 20px; font-size: 11.5px; line-height: 1.5; }
.badge-gray { background: var(--fill); color: #52525B; }
.badge-blue { background: var(--primary-soft); color: var(--primary-d); }
.badge-green { background: var(--ok-soft); color: #047857; }
.badge-yellow { background: var(--warn-soft); color: #B45309; }
.badge-red { background: var(--danger-soft); color: #B91C1C; }
.badge-purple { background: var(--purple-soft); color: #6D28D9; }

/* ============ 按钮 ============ */
.btn { padding: 7px 14px; border: none; border-radius: var(--radius-btn); cursor: pointer; font-size: 12.5px; font-family: inherit; font-weight: 500; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: var(--card); border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-sm { padding: 4.5px 11px; font-size: 12px; white-space: nowrap; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-soft-danger { background: var(--danger-soft); color: #B91C1C; }
.btn-soft-ok { background: var(--ok-soft); color: #047857; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font-size: 12.5px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.muted { color: var(--sub); }
.btn-link.danger { color: var(--danger); }
/* 不可点的操作（如内置 admin 不可删除）—— 灰掉 + 不显示手型光标 */
.btn-link.btn-link-off { color: var(--sub); opacity: .55; cursor: not-allowed; }
.btn-link.btn-link-off:hover { text-decoration: none; }

/* ============ 筛选栏 ============ */
.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar select, .filter-bar input {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-btn);
  font-size: 12.5px; font-family: inherit; background: var(--card); color: var(--text);
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--primary); }
.filter-spacer { margin-left: auto; }

/* ============ 分页条 ============ */
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.pager-info { font-size: 12px; color: var(--muted); }
.pager-btns { margin-left: auto; display: flex; gap: 5px; }
.pg-btn { min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-btn); cursor: pointer; font-size: 12px; color: var(--text); }
.pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============ 流程条 ============ */
.flow-strip { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 22px; margin-bottom: 14px; }
.flow-step { display: flex; align-items: center; gap: 9px; flex: 1; position: relative; }
.flow-num { width: 24px; height: 24px; border-radius: 50%; background: var(--fill); color: var(--sub); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0; }
.flow-step.done .flow-num { background: var(--ok); color: #fff; }
.flow-step.active .flow-num { background: var(--primary); color: #fff; }
.flow-label { font-size: 13px; color: var(--muted); }
.flow-step.done .flow-label, .flow-step.active .flow-label { color: var(--text); font-weight: 500; }
.flow-line { flex: 1; height: 1px; background: var(--line); margin: 0 14px; }

/* ============ 设计管理：列表 + 深化流程 ============ */
/* 左列表加宽到 620px：7 列一屏看完，不需要横向右拉 */
.design-layout {
  display: grid;
  grid-template-columns: 620px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - 250px);
  min-height: 560px;
}
/* 两栏各自内部滚动，左侧列表与右侧流程互不牵走 */
.design-layout > .card { display: flex; flex-direction: column; overflow: hidden; }
.design-layout > .card > .card-head { flex-shrink: 0; }
.design-list-card .pager, .design-list-card .pager-wrap { flex-shrink: 0; }
.design-list-card .table-wrap { overflow-x: hidden; overflow-y: auto; flex: 1; min-height: 0; }
#dPanel { min-height: 0; }
#dPanel .card-body { overflow-y: auto; flex: 1; min-height: 0; }
.design-list-table { table-layout: fixed; }
.design-list-table th, .design-list-table td {
  padding: 9px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-list-table th:nth-child(1) { width: 168px; }
.design-list-table th:nth-child(2) { width: 78px; }
.design-list-table th:nth-child(3) { width: 84px; }
.design-list-table th:nth-child(4) { width: 78px; }
.design-list-table th:nth-child(5) { width: auto; }
.design-list-table th:nth-child(6) { width: 66px; }
.design-list-table th:nth-child(7) { width: 62px; }
.design-list-table td.td-num { text-align: right; font-variant-numeric: tabular-nums; }
.design-list-table tr.row-sel td { background: var(--primary-soft); }
.design-list-table tr.row-sel .td-order-no { font-weight: 600; }

/* 深化面板头部 */
.dpanel-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.dpanel-title { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.dpanel-badge { margin-left: auto; }

/* 步骤卡片 */
.dsteps { display: flex; flex-direction: column; gap: 12px; }
.dstep {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
  overflow: hidden;
}
.dstep.todo { opacity: .72; }
.dstep.active { border-color: #BFDBFE; background: var(--card); box-shadow: 0 0 0 3px var(--primary-soft); }
.dstep.done { background: var(--card); }
.dstep-head { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); }
.dstep-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--fill); color: var(--sub);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.dstep.done .dstep-num { background: var(--ok); color: #fff; }
.dstep.active .dstep-num { background: var(--primary); color: #fff; }
.dstep-titles { flex: 1; min-width: 0; }
.dstep-title { font-size: 13.5px; font-weight: 600; }
.dstep-desc { font-size: 11.5px; color: var(--sub); margin-top: 2px; line-height: 1.5; }
.dstep-state { font-size: 11.5px; color: var(--sub); flex-shrink: 0; }
.dstep.done .dstep-state { color: var(--ok); }
.dstep.active .dstep-state { color: var(--primary); font-weight: 600; }
.dstep-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 13px 15px 15px;
}
.dstep-col { min-width: 0; }
.dstep-col-full { grid-column: 1 / -1; }
.dstep-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.dstep-count {
  display: inline-block; margin-left: 5px; padding: 0 6px;
  background: var(--fill); color: var(--sub); border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.att-empty {
  font-size: 11.5px; color: var(--sub);
  padding: 10px 11px; border: 1px dashed var(--line);
  border-radius: var(--radius-btn); margin-bottom: 7px;
}
.dstep-col .att-item { padding: 7px 10px; margin-bottom: 6px; }
.dstep-tip { font-size: 11.5px; color: var(--sub); margin-top: 7px; line-height: 1.6; }
.dstep-acts {
  grid-column: 1 / -1;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding-top: 12px; margin-top: 4px;
  border-top: 1px dashed var(--line-soft);
}

/* ============ 生产状态通栏（11 步） ============ */
/* 第 14 轮：通栏卡片头部的工单选择器 */
.pflow-picker { display: inline-flex; align-items: center; margin-left: 14px; }
.pflow-picker select { min-width: 220px; max-width: 340px; }
.pflow-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.pflow-head .kpi-note { white-space: nowrap; }
.pflow-track {
  flex: 1; height: 7px; background: var(--fill); border-radius: 4px; overflow: hidden;
}
.pflow-track > i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .25s; }
.pflow-bar {
  display: grid;
  /* 第 16 轮：通栏共 12 步（原 11 步 + 新增「订单结束」）—— 之前硬编码 14 导致右侧空一格 */
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}
.pflow-node {
  min-width: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-btn);
  background: var(--card-2); padding: 9px 7px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative;
}
.pflow-node:hover { border-color: var(--primary); background: var(--card); }
.pflow-node.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(10,10,11,.05); }
.pflow-node.done { background: #F0FDF4; border-color: #BBF7D0; }
.pflow-node.active { border-color: var(--primary); }
.pflow-idx {
  position: absolute; top: 5px; left: 6px;
  font-size: 10px; color: var(--sub); font-weight: 600;
}
.pflow-node.done .pflow-idx { color: var(--ok); }
.pflow-icon { font-size: 17px; line-height: 1.2; margin-top: 8px; }
.pflow-name {
  font-size: 11.5px; color: var(--text); font-weight: 600; text-align: center;
  line-height: 1.3; word-break: break-word;
}
.pflow-people {
  font-size: 10.5px; color: var(--primary); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pflow-files { font-size: 10.5px; color: var(--sub); }
.pflow-warn {
  font-size: 10px; color: var(--warn); background: #FEF9C3;
  border-radius: 8px; padding: 0 5px; line-height: 15px;
}
.pflow-detail {
  margin-top: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-btn); background: var(--card-2); overflow: hidden;
}
.pflow-dhead {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); background: var(--card);
}
.pflow-dicon { font-size: 20px; }
.pflow-dtitle { font-size: 14px; font-weight: 700; }
.pflow-dstate { margin-left: auto; }
.pflow-dbody {
  padding: 14px; display: flex; flex-direction: column; gap: 13px;
}
.pflow-files-box {
  border: 1px dashed var(--line); border-radius: var(--radius-btn);
  padding: 10px 11px; background: var(--card);
}
.pflow-files-box .att-item { margin-bottom: 6px; }
.pflow-acts { display: flex; gap: 8px; flex-wrap: wrap; }
/* 发货类节点的业务动作块 */
.pflow-ship {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--card);
}
.pflow-ship-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.sign-preview {
  max-width: 100%; border-radius: var(--radius-btn);
  border: 1px solid var(--line); margin: 4px 0 9px; display: block;
}
.dpanel-actions {
  display: flex; gap: 8px; margin-top: 12px;
  padding-top: 13px; border-top: 1px solid var(--line-soft); flex-wrap: wrap;
}

/* 第 13 轮：设计面板底部的「分派车间」区块 —— 一次性确认下发并进入生产 */
.dpanel-dispatch {
  margin-top: 16px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%);
}
.dpanel-dispatch-row { display: flex; gap: 14px; flex-wrap: wrap; }
.dpanel-dispatch-row .form-item { display: flex; flex-direction: column; gap: 6px; }
.dpanel-dispatch-row select, .dpanel-dispatch-row input { width: 100%; }
.dpanel-dispatch .dstep-tip { margin-top: 8px; }

/* ============ 详情页 ============ */
/* 订单详情：按 1080p（1920×1080）屏幕设计 —— 内容整体居中，
   不再贴着浏览器右边缘，两侧留白对称，视觉重心落在中间。 */
.detail-shell { max-width: 1320px; margin: 0 auto; width: 100%; }
.detail-shell .detail-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
.detail-shell .card + .card { margin-top: 20px; }
.detail-shell .card-head { padding: 16px 20px; }
.detail-shell .card-body { padding: 20px; }

.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.detail-back { color: var(--primary); cursor: pointer; font-size: 13px; }
.detail-back:hover { text-decoration: underline; }
.detail-no { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; }

/* ============ 键值表 ============ */
.kv-list { display: flex; flex-direction: column; gap: 9px; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 12.5px; }
.kv-k { color: var(--muted); flex-shrink: 0; }
.kv-v { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.kv-v.ok { color: var(--ok); }
.kv-v.warn { color: var(--warn); }
.kv-sep { border-top: 1px dashed var(--line); margin: 5px 0; }

/* ============ 状态流 ============ */
.status-flow { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.sf-item { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 12.5px; position: relative; }
.sf-dot { width: 9px; height: 9px; border-radius: 50%; background: #E4E4E7; flex-shrink: 0; z-index: 1; }
.sf-item.reached .sf-dot { background: var(--ok); }
.sf-item.current .sf-dot { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.sf-name { color: var(--sub); }
.sf-item.reached .sf-name, .sf-item.current .sf-name { color: var(--text); }
.sf-item.current .sf-name { font-weight: 600; }
.sf-note { margin-top: 8px; font-size: 11.5px; color: var(--sub); line-height: 1.6; padding-top: 9px; border-top: 1px dashed var(--line); }

/* ============ 工序 / 时间线 ============ */
.tl-group { margin-bottom: 14px; }
.tl-group-title { font-size: 12.5px; color: var(--primary-d); font-weight: 600; margin-bottom: 7px; }
.tl-item { display: flex; align-items: flex-start; gap: 8px; padding: 3.5px 0; font-size: 12.5px; }
.tl-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.tl-meta { color: var(--sub); font-size: 11.5px; margin-left: 6px; }

/* ============ 勾选框 ============ */
.ck { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }

/* ============ 弹窗 ============ */
.mask { position: fixed; inset: 0; background: rgba(10,10,11,.45); z-index: 50; }
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 18px; }
/* ★ 2026-11-06：全站弹窗统一 1080（用户要求「所有弹窗均做1080」） */
.modal-box { background: var(--card); border-radius: 10px; width: min(1080px, 96vw); max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,.22); }
.modal-box.modal-sm { width: min(1080px, 96vw); }
.modal-box.modal-lg { width: min(1080px, 96vw); }
.modal-box.modal-xl { width: min(1080px, 96vw); }
.modal-box.modal-xxl { width: min(1080px, 96vw); }
.modal-box.modal-xxl .modal-body { padding: 22px 26px; }
/* ★ 2026-11-06：modal-hd —— 大表单弹窗（新建客户等），字号与全站弹窗一致 */
.modal-box.modal-hd { width: min(1080px, 96vw); }
.modal-box.modal-hd .modal-body { padding: 26px 34px; }
.modal-box.modal-hd input, .modal-box.modal-hd select, .modal-box.modal-hd textarea {
  padding: 9px 11px;
}
.modal-box.modal-hd textarea { min-height: 96px; }
.modal-box.modal-hd .form-row { gap: 18px 24px; margin-bottom: 14px; }
.modal-box.modal-xl .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modal-box.modal-xl .form-grid.modal-xl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 全局弹窗底部按钮加大（所有尺寸的弹窗统一） */
.modal-box .modal-foot .btn-ghost,
.modal-box .modal-foot .btn-primary,
.modal-box .modal-foot .btn-danger { padding: 11px 32px; font-size: 15px; border-radius: 8px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-title { font-size: 16.5px; font-weight: 600; }
.modal-x { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--sub); line-height: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--line-soft); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 15px; }
/* ★ 2026-11-06：.form-row 一直没有样式（CRM 客户表单因此塌成单列），补两列网格 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 12px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item.full { grid-column: 1 / -1; }
/* ★ 2026-11-06：弹窗内字体统一加大 2 号（用户要求，全部弹窗生效） */
.form-item label { font-size: 14px; color: var(--muted); }
.form-item input, .form-item select, .form-item textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-btn);
  font-size: 15px; font-family: inherit; color: var(--text); background: var(--card);
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-item textarea { resize: vertical; min-height: 62px; }
.form-item .hint { font-size: 13px; color: var(--sub); }
.required::after { content: " *"; color: var(--danger); }
.form-note { background: var(--primary-soft); border-left: 2px solid var(--primary); padding: 9px 12px; border-radius: 0 var(--radius-btn) var(--radius-btn) 0; font-size: 14px; color: var(--primary-d); margin-bottom: 14px; line-height: 1.6; }
.form-note.warn { background: var(--warn-soft); border-color: var(--warn); color: #B45309; }
.form-note.danger { background: var(--danger-soft); border-color: var(--danger); color: #B91C1C; }

/* ============ 明细编辑 ============ */
.item-rows { border: 1px solid var(--line); border-radius: var(--radius-btn); overflow: auto; }
.item-row { display: grid; grid-template-columns: 1.5fr 1fr .6fr .9fr .9fr 28px; gap: 6px; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); align-items: center; }
.item-row.head { background: var(--bg); font-weight: 500; font-size: 13.5px; color: var(--muted); }
.item-row input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 13.5px; width: 100%; font-family: inherit; }
.item-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 15px; }
.item-total { text-align: right; padding: 9px 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ 提示 ============ */
.toast { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 9px 20px; border-radius: var(--radius-btn); z-index: 100; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 70vw; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

/* ============ 附件 / 签名 ============ */
.att-item { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--line-soft); border-radius: var(--radius-btn); margin-bottom: 7px; font-size: 12.5px; }
.att-thumb { width: 34px; height: 34px; border-radius: 5px; background: var(--fill); display: flex; align-items: center; justify-content: center; color: var(--sub); font-size: 15px; flex-shrink: 0; }
.att-name { flex: 1; word-break: break-all; }
.att-meta { color: var(--sub); font-size: 11.5px; }
.sign-box { border: 1.5px dashed var(--line); border-radius: var(--radius); min-height: 96px; display: flex; align-items: center; justify-content: center; background: var(--card-2); margin-bottom: 10px; }
.sign-box-empty, .sign-box-done { cursor: pointer; transition: border-color .15s, background .15s; }
.sign-box-empty { border-color: var(--primary); background: var(--primary-soft); }
.sign-box-empty:hover { border-style: solid; background: #E8EEFC; }
.sign-box-done { border-style: solid; background: var(--card); flex-direction: column; padding: 10px; }
.sign-box-done:hover { border-color: var(--primary); }
.sign-placeholder { font-size: 14px; color: var(--primary); font-weight: 500; }
.sign-meta { font-size: 12px; color: var(--ok); margin-top: 6px; }
.sign-box-done .sign-preview { margin: 0 0 4px; }
.sign-canvas { border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--card); touch-action: none; cursor: crosshair; display: block; margin: 0 auto; }
.sign-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ============ 权限矩阵 ============ */
.perm-layout { display: flex; gap: 14px; align-items: flex-start; }
.perm-roles { flex: 0 0 168px; display: flex; flex-direction: column; gap: 5px; }
.perm-role { padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--radius-btn); cursor: pointer; background: var(--card); font-size: 13px; }
.perm-role.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.perm-panel { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.perm-group { margin-bottom: 14px; }
.perm-group-title { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 7px; padding-bottom: 5px; border-bottom: 1px dashed var(--line); }
.perm-items { display: flex; flex-wrap: wrap; gap: 7px; }
.perm-item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--bg); font-size: 12.5px; cursor: pointer; }
.perm-item input { accent-color: var(--primary); }

/* ============ 生产：发货协同 ============ */
.gate-list { display: flex; flex-direction: column; gap: 8px; }
.gate { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-btn); border: 1px solid var(--line); font-size: 12.5px; }
.gate.ok { border-color: #A7F3D0; background: var(--ok-soft); }
.gate.wait { border-color: #FDE68A; background: var(--warn-soft); }
.gate-icon { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.gate.ok .gate-icon { background: var(--ok); color: #fff; }
.gate.wait .gate-icon { background: var(--warn); color: #fff; }
.gate-label { flex: 1; }
.gate-state { font-weight: 600; font-size: 12px; }
.gate.ok .gate-state { color: #047857; }
.gate.wait .gate-state { color: #B45309; }
/* 加宽弹窗内的关卡横向排布 */
.gate-list-h { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gate-list-h .gate { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
.gate-list-h .gate-icon { width: 24px; height: 24px; font-size: 12px; }
.gate-list-h .gate-label { flex: none; font-weight: 600; }
.gate-list-h .gate-state { font-size: 11.5px; }

/* ============ 工单详情 · 16 步流程状态摘要 ============ */
.pdlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pdlg-head-stat { text-align: right; flex-shrink: 0; }
.pdlg-hs-num { font-size: 30px; font-weight: 800; line-height: 1; color: var(--primary); letter-spacing: -.5px; }
.pdlg-hs-num span { font-size: 15px; font-weight: 600; color: var(--sub); }
.pdlg-hs-lab { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pstat { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, #FBFCFE 0%, #F6F8FB 100%); }
.pstat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pstat-title { font-size: 13px; font-weight: 700; }
.pstat-cur { font-size: 12px; color: var(--primary-d); font-weight: 600; }
.pstat-bar { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin: 10px 0 12px; }
.pstat-bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary) 0%, #22D3EE 100%); transition: width .3s ease; }
.pstat-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.fsdot { width: 100%; flex: 1 1 0; min-width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.fsdot.ok { background: var(--ok); }
.fsdot.now { background: var(--primary); }
.fsdot.todo { background: #E4E4E7; }
.pstat-legend { display: flex; align-items: center; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pstat-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pstat-legend .fsdot { width: 9px; height: 9px; flex: none; }
.pstat-total { margin-left: auto; font-weight: 700; color: var(--text); }

/* ============ 进度条 ============ */
.bar { height: 7px; background: var(--fill); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }
.bar > i.danger { background: var(--danger); }

/* ============ Tab ============ */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 16px; cursor: pointer; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2-32 { grid-template-columns: 1fr; }
  .pflow-bar { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; width: 220px; }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar-search input { width: 130px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- 数据新鲜度提示 / 表单内说明 ---------- */
.auto-refresh-tip { color: var(--text-3, #8A8F99); font-size: 12px; margin-left: 8px; }
.form-tip { font-size: 11.5px; color: var(--text-3, #8A8F99); line-height: 1.6; }

/* ============================================================
   订单流程导航（v2.2）
   解决「新建订单走流程看着蒙蔽」：把 6 个关卡、每关责任岗位、
   当前卡点、我能做的动作，全都显式画出来。
   ============================================================ */

/* 横向 6 关流程条（建单前的全貌预览 / 列表页复用） */
.flow-track { display: flex; align-items: stretch; gap: 0; margin: 0; padding: 0; list-style: none; }
.flow-node {
  flex: 1 1 0; min-width: 0; position: relative;
  padding: 10px 8px 10px 16px; background: var(--bg);
  border: 1px solid var(--line); border-right-width: 0;
  font-size: 12px; color: var(--sub);
}
.flow-node:first-child { border-radius: var(--radius-btn) 0 0 var(--radius-btn); padding-left: 12px; }
.flow-node:last-child { border-right-width: 1px; border-radius: 0 var(--radius-btn) var(--radius-btn) 0; }
.flow-node::after {
  content: ""; position: absolute; right: -9px; top: 50%; z-index: 2;
  width: 16px; height: 16px; margin-top: -8px;
  background: var(--bg); border-top: 1px solid var(--line); border-right: 1px solid var(--line);
  transform: rotate(45deg);
}
.flow-node:last-child::after { display: none; }
.flow-node.done { background: var(--ok-soft); border-color: #A7F3D0; color: #047857; }
.flow-node.done::after { background: var(--ok-soft); border-color: #A7F3D0; }
.flow-node.current {
  background: var(--primary-soft); border-color: #93C5FD; color: var(--primary-d);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.flow-node.current::after { background: var(--primary-soft); border-color: #93C5FD; }
.flow-node-idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; margin-right: 5px;
  background: var(--line); color: var(--sub); font-size: 10px; font-weight: 600;
  vertical-align: -2px;
}
.flow-node.done .flow-node-idx { background: var(--ok); color: #fff; }
.flow-node.current .flow-node-idx { background: var(--primary); color: #fff; }
.flow-node-name { font-weight: 600; font-size: 12.5px; }
.flow-node-owner { display: block; margin-top: 3px; font-size: 11px; opacity: .82; }

/* 当前关卡卡点（谁该做 / 卡在哪） */
.flow-now {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius-btn);
  background: var(--primary-soft); border: 1px solid #BFDBFE;
}
.flow-now-ico {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.flow-now-body { flex: 1 1 220px; min-width: 0; }
.flow-now-title { font-size: 12.5px; font-weight: 600; color: var(--primary-d); }
.flow-now-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.flow-now-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.flow-now-acts .btn { padding: 5px 12px; font-size: 12px; }

/* 列表页「下一步」单元格 */
.next-cell { display: flex; flex-direction: column; gap: 3px; }
.next-cell-main { font-size: 12.5px; color: var(--text); font-weight: 500; }
.next-cell-sub { font-size: 11px; color: var(--sub); line-height: 1.45; }
.next-cell-act { font-size: 11.5px; color: var(--primary-d); cursor: pointer; }
.next-cell-act:hover { text-decoration: underline; }
.next-cell.none { color: var(--sub); font-size: 12px; }

/* 表单分区标题（建单三段式） */
.form-sec {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px;
  margin-top: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
.form-sec:first-child { margin-top: 0; }
.form-sec-t { font-size: 14.5px; font-weight: 600; color: var(--text); }
/* 表单字段下方的一行小字说明（第 24 轮：新建耗材提示） */
.form-hint { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 5px; }
.form-hint b { color: var(--primary-d); font-weight: 600; }
.form-sec-d { font-size: 13.5px; color: var(--sub); }

/* 详情页纵向流程轨（替代旧的 6 点 status-flow） */
.flow-rail { display: flex; flex-direction: column; }
.flow-rail-node { display: flex; gap: 10px; position: relative; padding-bottom: 14px; }
.flow-rail-node:last-child { padding-bottom: 0; }
.flow-rail-node::before {
  content: ""; position: absolute; left: 10px; top: 22px; bottom: 0;
  width: 2px; background: var(--line);
}
.flow-rail-node:last-child::before { display: none; }
.flow-rail-node.done::before { background: var(--ok); }
.flow-rail-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; z-index: 1;
  background: var(--card); border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--sub); font-weight: 600;
}
.flow-rail-node.done .flow-rail-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.flow-rail-node.current .flow-rail-dot {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.flow-rail-body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.flow-rail-title { font-size: 13px; font-weight: 600; color: var(--text); }
.flow-rail-node:not(.current):not(.done) .flow-rail-title { color: var(--sub); font-weight: 500; }
.flow-rail-meta { font-size: 11.5px; color: var(--sub); margin-top: 2px; line-height: 1.5; }
.flow-rail-block { font-size: 11.5px; color: #B45309; margin-top: 3px; }
.flow-rail-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.flow-rail-acts .btn { padding: 4px 11px; font-size: 11.5px; }

/* 建单成功后的行动卡 */
.flow-done-card {
  text-align: center; padding: 6px 0 2px;
}
.flow-done-ico {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--ok-soft); color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.flow-done-title { font-size: 15px; font-weight: 600; color: var(--text); }
.flow-done-no { font-size: 12px; color: var(--sub); margin-top: 3px; font-family: ui-monospace, monospace; }
.flow-done-next {
  margin: 14px 0 4px; padding: 12px; text-align: left;
  background: var(--primary-soft); border: 1px solid #BFDBFE; border-radius: var(--radius-btn);
}
.flow-done-next-t { font-size: 12.5px; font-weight: 600; color: var(--primary-d); margin-bottom: 7px; }
.flow-done-next-list { display: flex; flex-direction: column; gap: 5px; }
.flow-done-next-item { font-size: 12px; color: var(--muted); display: flex; gap: 7px; align-items: flex-start; }
.flow-done-next-item b { color: var(--text); font-weight: 600; }
.flow-done-next-idx {
  width: 16px; height: 16px; border-radius: 50%; background: #DBEAFE; color: var(--primary-d);
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}

/* ============ 报价器会员管理（2026-10-25 新增） ============ */
/* 6 列统计卡（kpi-grid 默认 4 列，这里按会员统计需要扩展） */
.kpi-grid.kpi-grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .kpi-grid.kpi-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .kpi-grid.kpi-grid-6 { grid-template-columns: repeat(2, 1fr); } }

/* 筛选栏右侧说明文字 */
.filter-note { font-size: 12px; color: var(--muted); align-self: center; }

/* 表格单元格内的次要说明 */
.td-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* 弹窗内嵌表格（凭证查看 / 流水） */
.modal-body .table-wrap { max-height: 60vh; overflow-y: auto; }
.modal-body .table-wrap table { font-size: 14.5px; }
/* ★ 2026-11-06：弹窗字号统一兜底 —— 任何弹窗（含新建客户 modal-hd 及业务自定义弹窗）
   内的标签一律 14px、输入框/下拉一律 15px，后面任何新弹窗都不会再漏 */
.modal-box label, .modal-box .form-label, .modal-box .form-item label { font-size: 14px; }
.modal-box input, .modal-box select, .modal-box textarea { font-size: 15px; }
.modal-box .form-item .hint, .modal-box .form-hint { font-size: 13px; }

/* 文件选择框（会员申请材料上传） */
input[type="file"].file-input,
.file-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  border: 1px dashed var(--line);
  border-radius: var(--radius-btn);
  background: var(--bg);
  cursor: pointer;
}
.file-input::file-selector-button {
  margin-right: 10px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--card);
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

/* ============================================================
   消息中心 + 我的账号（2026-10-31）
   ============================================================ */

/* ---------- 消息中心 ---------- */
.nt-tabs { margin-bottom: 0; border-bottom: none; flex: 1; flex-wrap: wrap; }
.nt-tabs .tab { padding: 7px 12px; font-size: 12.5px; }
.nt-head-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nt-chk { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; }

.nt-list { max-height: calc(100vh - 250px); overflow-y: auto; }
.nt-item {
  display: flex; gap: 11px; padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .12s;
}
.nt-item:hover { background: var(--primary-soft); }
.nt-item:last-child { border-bottom: none; }
.nt-item.unread { background: #FBFDFF; }
.nt-item.unread:hover { background: var(--primary-soft); }

.nt-icon {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.nt-icon.blue   { background: #EFF6FF; color: #2563EB; }
.nt-icon.amber  { background: #FFFBEB; color: #B45309; }
.nt-icon.green  { background: #ECFDF5; color: #047857; }
.nt-icon.purple { background: #F5F3FF; color: #6D28D9; }
.nt-icon.teal   { background: #F0FDFA; color: #0F766E; }
.nt-icon.red    { background: #FEF2F2; color: #B91C1C; }
.nt-icon.gray   { background: var(--fill); color: #52525B; }

.nt-main { flex: 1; min-width: 0; }
.nt-head { display: flex; align-items: center; gap: 6px; }
.nt-title { font-size: 13px; font-weight: 500; color: var(--text); }
.nt-item.unread .nt-title { font-weight: 600; }
.nt-body {
  font-size: 12.5px; color: var(--muted); margin-top: 4px;
  line-height: 1.6; word-break: break-word;
}
.nt-foot { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.nt-type {
  font-size: 11px; padding: 1.5px 7px; border-radius: 10px;
  background: var(--fill); color: var(--muted);
}
.nt-type.blue   { background: #EFF6FF; color: #2563EB; }
.nt-type.amber  { background: #FFFBEB; color: #B45309; }
.nt-type.green  { background: #ECFDF5; color: #047857; }
.nt-type.purple { background: #F5F3FF; color: #6D28D9; }
.nt-type.teal   { background: #F0FDFA; color: #0F766E; }
.nt-type.red    { background: #FEF2F2; color: #B91C1C; }
.nt-time { font-size: 11.5px; color: var(--sub); }
.nt-go {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--primary); padding: 0;
}
.nt-go:hover { text-decoration: underline; }

/* ★ 2026-11-01 会员申请消息行：查看付款凭证 / 开通 快捷按钮 */
.nt-acts { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nt-acts .nt-go { margin-left: 0; }
.nt-act {
  background: none; border: none; cursor: pointer;
  font-size: 12px; padding: 2px 4px; border-radius: 6px;
}
.nt-act:disabled { opacity: .5; cursor: not-allowed; }
.nt-proof { color: #047857; }
.nt-proof:hover { background: #ECFDF5; }
.nt-approve {
  color: #fff; background: var(--primary, #2563eb);
  padding: 3px 12px; border-radius: 12px; font-weight: 600;
}
.nt-approve:hover { filter: brightness(1.08); }
/* 凭证悬停预览卡（鼠标靠近按钮即弹出，无需点击） */
#ntProofPop {
  position: fixed; z-index: 300; display: none;
  width: 260px; padding: 8px;
  background: var(--card); border: 1px solid var(--line, #e3e5ea); border-radius: 10px;
  box-shadow: 0 12px 36px rgba(2, 8, 23, .18);
}
#ntProofPop.is-on { display: block; }
#ntProofPop img {
  display: block; width: 100%; max-height: 340px; object-fit: contain;
  border-radius: 6px; background: #f8fafc;
}
#ntProofPop .ntpp-tip {
  padding: 10px 6px; text-align: center;
  font-size: 12px; color: var(--muted, #64748b); line-height: 1.7;
}

/* ★ 2026-11-01 消息中心编辑能力 + 版面美化 */
/* 标签栏：胶囊式，替代原来的系统默认按钮（Win98 风） */
.nt-tabs { border-bottom: none; margin-bottom: 0; gap: 8px; flex-wrap: wrap; }
.nt-tabs .tab {
  border: 1px solid var(--line, #e3e5ea);
  border-bottom: 1px solid var(--line, #e3e5ea);
  border-radius: 18px;
  padding: 7px 16px; margin-bottom: 0;
  background: var(--card); font-size: 13px; color: var(--muted);
  transition: all .15s;
}
.nt-tabs .tab:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft, #F5F8FF); }
.nt-tabs .tab.active {
  background: var(--primary, #2563eb); border-color: var(--primary, #2563eb);
  color: #fff; font-weight: 600;
}
/* 批量操作条 */
.nt-batchbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; margin-top: 12px;
  background: #F8FAFC; border: 1px solid var(--line-soft, #eef0f3); border-radius: 10px;
}
.nt-selinfo { font-size: 12.5px; color: var(--primary); font-weight: 600; min-width: 64px; }
.nt-batchbar .nt-batch-read { background: var(--primary, #2563eb); color: #fff; border: none; }
.nt-batchbar .nt-batch-read:hover { filter: brightness(1.08); }
.nt-batchbar .nt-batch-read:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.nt-batchbar .nt-batch-del { background: var(--card); color: #dc2626; border: 1px solid #fca5a5; }
.nt-batchbar .nt-batch-del:hover { background: #fef2f2; }
.nt-batchbar .nt-batch-del:disabled { opacity: .45; cursor: not-allowed; }
.nt-batchtip { font-size: 11.5px; color: var(--sub, #94a3b8); }
/* 行首勾选框 */
.nt-check { display: flex; align-items: center; padding-top: 3px; cursor: pointer; }
.nt-check input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary, #2563eb); }
/* 单条操作按钮 */
.nt-act.nt-markread { color: var(--primary, #2563eb); }
.nt-act.nt-markread:hover { background: var(--primary-soft, #F5F8FF); }
.nt-act.nt-del { color: #dc2626; }
.nt-act.nt-del:hover { background: #fef2f2; }

/* ---------- 我的账号 ---------- */
.pf-top { display: flex; gap: 18px; align-items: center; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.pf-avatar {
  width: 72px; height: 72px; flex: 0 0 72px; border-radius: 50%;
  background: var(--primary); color: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pf-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-avatar-initial { font-size: 28px; font-weight: 600; }
.pf-top-info { min-width: 0; }
.pf-name { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.pf-sub { font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.pf-warn {
  display: inline-block; margin-top: 7px; font-size: 12px;
  background: var(--warn-soft); color: #B45309;
  padding: 3px 9px; border-radius: var(--radius-btn);
}

.pf-row { margin-bottom: 14px; }
.pf-row .form-item { gap: 6px; }
.pf-row-body { display: flex; align-items: center; gap: 10px; }
.pf-row-body .hint { font-size: 11px; color: var(--sub); }
.pf-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.pf-actions .hint { font-size: 11.5px; color: var(--sub); }

/* ============================================================
   侧边栏收窄成图标栏（2026-11-01）
   点 sidebar 底部 « 按钮 → 整栏缩成 52px 只留图标（悬停看名称）；
   再点 » 展开。状态存 localStorage，刷新不丢。
   只在桌面端（>760px）生效 —— 小屏是抽屉式侧栏，不参与收窄。
   ============================================================ */
.sidebar { transition: width .18s ease; }
.side-toggle {
  flex-shrink: 0; margin: 6px auto 10px; width: 26px; height: 26px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.side-toggle:hover { background: var(--bg); color: var(--text); }
@media (min-width: 761px) {
  #sidebar.collapsed { width: 52px; }
  #sidebar.collapsed .brand { padding: 0; justify-content: center; gap: 0; }
  #sidebar.collapsed .brand-text { display: none; }
  #sidebar.collapsed .menu { overflow-x: hidden; }
  /* 分组标题（客户资源/经营/生产/系统）收窄时变成细分隔线 */
  #sidebar.collapsed .menu-group {
    height: 1px; margin: 9px 12px; padding: 0;
    background: var(--line-soft); color: transparent; overflow: hidden;
  }
  #sidebar.collapsed .menu-item { padding: 9px 0; justify-content: center; gap: 0; }
  #sidebar.collapsed .menu-item > span:not(.menu-icon) { display: none; }
  #sidebar.collapsed .menu-icon { width: auto; font-size: 15px; }
  #sidebar.collapsed .sidebar-foot { padding: 6px 4px; text-align: center; }
  #sidebar.collapsed .sf-line { display: none; }
}

/* ============================================================
   菜单分组折叠（2026-11-01）
   组名（客户资源/经营/生产/系统）可点击：点一下收起该组、
   再点展开；箭头 ▾/▸ 指示状态；按组记忆在 localStorage。
   ============================================================ */
.menu-group { display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.menu-group:hover { color: var(--text); }
.mg-arrow { margin-left: auto; font-size: 10px; font-weight: 400; opacity: .45; transition: transform .15s ease; }
.menu-cat.closed .menu-item { display: none; }
.menu-cat.closed .mg-arrow { transform: rotate(-90deg); }

/* ---- 手机端优化（2026-11-05，从手机版合并回来） ---- */
@media (max-width: 640px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { width: 100%; max-height: 94vh; border-radius: 14px 14px 0 0; box-shadow: 0 -12px 48px rgba(0,0,0,.22); }
  .modal-box.modal-sm, .modal-box.modal-lg, .modal-box.modal-xl, .modal-box.modal-xxl { width: 100%; }
  .modal-box.modal-xl .form-grid { grid-template-columns: 1fr; }
  .modal-box .modal-foot .btn-ghost,
  .modal-box .modal-foot .btn-primary,
  .modal-box .modal-foot .btn-danger { padding: 11px 20px; font-size: 14.5px; flex: 1; }
  .card-body { padding: 12px; }
  th, td { padding: 9px 10px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .btn { -webkit-tap-highlight-color: transparent; }
}
