/* ============================================================
   关澜ERP · R4.5 主题层 theme.css
   1) 深色主题（html[data-theme="dark"]）
   2) 顶栏一级菜单 + 悬停子菜单（无侧栏）
   3) 用户胶囊下拉 / 面包屑条
   4) 账号设置页
   5) 看板布局编辑（拖拽排序 + 板块宽度）
   加载顺序：style.css → crm.css → theme.css（最后覆盖）
   ============================================================ */

/* ============ 1. 深色主题令牌 ============ */
html[data-theme="dark"] {
  --bg: #0F1115;
  --card: #171A21;
  --card-2: #1A1E27;
  --fill: #222833;
  --text: #E8ECF3;
  --muted: #9AA4B8;
  --sub: #6B7588;
  --line: #262B36;
  --line-soft: #1F2430;
  --ok-soft: rgba(6, 153, 73, .16);
  --warn-soft: rgba(196, 125, 10, .18);
  --danger-soft: rgba(217, 45, 32, .18);
  --purple-soft: rgba(124, 58, 237, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
html[data-theme="dark"] .badge-gray { color: #A2ACBE; }
html[data-theme="dark"] .badge-green { color: #6EE7A8; }
html[data-theme="dark"] .badge-yellow { color: #F5C877; }
html[data-theme="dark"] .badge-red { color: #FDA4A0; }
html[data-theme="dark"] .badge-purple { color: #C4B5FD; }
html[data-theme="dark"] .btn-soft-danger { color: #FDA4A0; }
html[data-theme="dark"] .btn-soft-ok { color: #6EE7A8; }
html[data-theme="dark"] .kpi-note.up { color: #6EE7A8; }
html[data-theme="dark"] .login-wrap { background: linear-gradient(135deg, #07090D 0%, #141824 55%, #221E4A 100%); }
html[data-theme="dark"] .login-box { border: 1px solid var(--line); }
html[data-theme="dark"] img { filter: brightness(.92); }
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2C3340; border: 2px solid var(--bg); border-radius: 6px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3A4354; }

/* 浅色滚动条（默认） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D8DCE4; border: 2px solid var(--bg); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #C2C8D4; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 2. 布局骨架（无侧栏） ============ */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.sidebar { display: none !important; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ============ 3. 顶栏：品牌 + 一级菜单 + 悬停子菜单 ============ */
.gnav {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  position: relative; z-index: 60;
}
.gnav-brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; cursor: pointer; }
.gnav-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
.gnav-brand .bn-accent { color: var(--primary); }

.gnav-menu { display: flex; align-items: center; gap: 2px; height: 100%; min-width: 0; }
.gnav-item { position: relative; height: 100%; display: flex; align-items: center; }
.gnav-item::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; } /* 悬停桥接，防闪烁 */
.gnav-link {
  display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px;
  border-radius: 8px; color: var(--muted); font-size: 13.5px; cursor: pointer;
  user-select: none; white-space: nowrap; transition: background .15s, color .15s;
}
.gnav-item:hover > .gnav-link { background: var(--fill); color: var(--text); }
.gnav-item.active > .gnav-link { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.gnav-caret { font-size: 9px; opacity: .55; margin-left: 1px; }

.gdd {
  position: absolute; top: calc(100% - 6px); left: 0; min-width: 232px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); padding: 6px; display: none; z-index: 80;
}
.gnav-item:hover > .gdd { display: block; animation: gdrop .14s ease; }
@keyframes gdrop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.gdi {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none;
}
.gdi:hover { background: var(--fill); color: var(--text); }
.gdi.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.gdi-ic { width: 18px; text-align: center; font-size: 12.5px; opacity: .9; flex-shrink: 0; }
.gdi-tag { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--primary); background: var(--primary-soft); border-radius: 4px; padding: 1px 6px; }
.gdi-sub { margin-left: auto; font-size: 11px; color: var(--sub); }
.gdiv { height: 1px; background: var(--line); margin: 5px 6px; }

/* 顶栏右侧 */
.gnav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gnav .topbar-search { position: relative; }
.gnav .topbar-search input {
  width: 240px; height: 32px; padding: 0 12px 0 30px; border: 1px solid transparent; border-radius: 8px;
  background: var(--fill); color: var(--text); font-size: 12.5px; font-family: inherit;
}
.gnav .topbar-search input:focus { outline: none; background: var(--card); border-color: var(--primary); }
.gnav .ts-icon { left: 10px; font-size: 12.5px; color: var(--sub); }
.gnav .icon-btn { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.gnav .icon-btn:hover { background: var(--fill); }

/* 用户胶囊 */
.uchip { position: relative; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border-radius: 999px; cursor: pointer; user-select: none; }
.uchip:hover { background: var(--fill); }
.uchip .avatar { width: 28px; height: 28px; font-size: 12px; }
.uchip-meta { display: flex; flex-direction: column; line-height: 1.15; max-width: 130px; }
.uchip-meta .user-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uchip-meta .user-role { font-size: 10.5px; color: var(--sub); background: none; padding: 0; }
.uchip-caret { font-size: 9px; color: var(--sub); }
.uchip-dd {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 208px; display: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 90;
}
.uchip.open .uchip-dd { display: block; animation: gdrop .14s ease; }
.udhead { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.udhead b { font-size: 13px; }
.udhead span { display: block; font-size: 11px; color: var(--sub); margin-top: 1px; }
.udi { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.udi:hover { background: var(--fill); color: var(--text); }
.udi.danger { color: var(--danger); }

/* 面包屑条 */
.crumb {
  height: var(--crumb-h); flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 0 22px; font-size: 12.5px; color: var(--sub);
  background: var(--card); border-bottom: 1px solid var(--line-soft);
}
.crumb b { color: var(--text); font-weight: 600; }
.crumb .csep { color: var(--line); }
.crumb .cright { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--sub); }
.crumb .live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* 内容区全宽 */
.content { flex: 1; overflow-y: auto; padding: 18px 22px 44px; background: var(--bg); }
.content > .page-head { margin-bottom: 16px; }

/* 移动端 */
.menu-btn { display: none; font-size: 18px; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px 8px; border-radius: 8px; }
@media (max-width: 1180px) {
  .gnav .topbar-search input { width: 150px; }
  .uchip-meta { display: none; }
}
@media (max-width: 1024px) {
  .menu-btn { display: inline-flex; align-items: center; }
  .gnav-menu {
    display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0;
    height: auto; flex-direction: column; align-items: stretch; background: var(--card);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-pop); padding: 8px; max-height: 76vh; overflow-y: auto; z-index: 70;
  }
  .gnav-menu.open { display: flex; }
  .gnav-item { height: auto; display: block; }
  .gnav-item::after { display: none; }
  .gnav-link { height: 40px; font-size: 14px; }
  .gnav-link .gnav-caret { margin-left: auto; }
  .gdd { position: static; display: block; box-shadow: none; border: none; padding: 0 0 4px 14px; min-width: 0; }
  .content { padding: 14px 14px 40px; }
  .crumb { padding: 0 14px; }
}

/* ============ 4. 账号设置页 ============ */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .set-grid { grid-template-columns: 1fr; } }
.sect { padding: 18px 20px; }
.sect-h { margin-bottom: 14px; }
.sect-h .stt { font-size: 14px; font-weight: 600; }
.sect-h .ssb { font-size: 11.5px; color: var(--sub); margin-top: 2px; }
.avat-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-big {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 700; flex-shrink: 0; cursor: pointer; user-select: none;
  transition: transform .15s; box-shadow: 0 4px 12px rgba(16, 24, 40, .14);
}
.avatar-big:hover { transform: scale(1.05); }
.avat-info b { font-size: 13.5px; display: block; }
.avat-info span { font-size: 11.5px; color: var(--sub); }
.frow { display: flex; align-items: flex-start; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.frow:last-child { border-bottom: none; }
.frow > .fl { width: 96px; flex-shrink: 0; font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.frow > .fv { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inp, .set-grid input[type="text"], .set-grid input[type="password"], .set-grid input[type="tel"], .set-grid select {
  width: 100%; height: 34px; padding: 0 11px; font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--fill); border: 1px solid transparent; border-radius: 8px; outline: none; transition: all .15s;
}
.inp:focus, .set-grid input:focus, .set-grid select:focus { background: var(--card); border-color: var(--primary); }
.inp-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fhint { font-size: 11.5px; color: var(--sub); }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 3px; gap: 2px; }
.seg i { font-style: normal; font-size: 12px; color: var(--muted); padding: 5px 12px; border-radius: 7px; cursor: pointer; user-select: none; white-space: nowrap; }
.seg i.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.swatches { display: flex; gap: 8px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line) inset; transition: transform .12s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--card); box-shadow: 0 0 0 2px var(--text); }
.swatch-custom { width: 30px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: transparent; cursor: pointer; }
.tog { position: relative; width: 38px; height: 21px; border-radius: 999px; background: var(--fill); border: 1px solid var(--line); cursor: pointer; flex-shrink: 0; transition: background .15s, border-color .15s; }
.tog::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(16, 24, 40, .2); transition: transform .16s; }
.tog.on { background: var(--primary); border-color: var(--primary); }
.tog.on::after { transform: translateX(17px); background: #fff; }
.pwd-sep { margin-top: 4px; }

/* ============ 5. 看板布局编辑 ============ */
.lay { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; align-items: stretch; }
.lay > .lb { position: relative; min-width: 0; }
.lb.w2 { grid-column: span 2; } .lb.w3 { grid-column: span 3; } .lb.w4 { grid-column: span 4; } .lb.w6 { grid-column: span 6; }
.lb > .card { height: 100%; }
.lb > .kpi-grid { margin-bottom: 0; }
.lbhd { display: none; position: absolute; top: -12px; left: 10px; z-index: 8; gap: 5px; }
.lbhd button {
  height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 11px; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  box-shadow: var(--shadow);
}
.lbhd button:hover { color: var(--primary); border-color: var(--primary-line); }
.lay.editing { padding-top: 12px; }
.lay.editing > .lb { outline: 1.5px dashed var(--primary-line); outline-offset: 5px; border-radius: 16px; }
.lay.editing > .lb[draggable="true"] { cursor: grab; }
.lay.editing > .lb * { pointer-events: none; }
.lay.editing > .lb > .lbhd, .lay.editing > .lb > .lbhd * { pointer-events: auto; }
.lay.editing .lbhd { display: flex; }
.lb.dragging { opacity: .4; }
.lay-edit-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }

@media (max-width: 1100px) {
  .lb.w2, .lb.w3, .lb.w4 { grid-column: span 6; }
}

/* ============ 6. 通用修补（R4.5 观感） ============ */
.page-title-lg { letter-spacing: -.3px; }
.card { box-shadow: var(--shadow); }
.modal-box { box-shadow: var(--shadow-pop); border-radius: 14px; }
.toast { border-radius: 10px; }
.badge { font-weight: 500; }

/* 布局工具条 */
.lay-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 10px; }
.lay-hint { font-size: 11.5px; color: var(--sub); }
.lay-edit-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.lbhd .nmz { color: var(--sub); cursor: default; }
.lbhd .nmz:hover { color: var(--sub); border-color: var(--line); }

/* 紧凑密度 */
html[data-density="compact"] .card-body { padding: 12px; }
html[data-density="compact"] th, html[data-density="compact"] td { padding: 7px 12px; }
html[data-density="compact"] .kpi { padding: 11px 13px; }
html[data-density="compact"] .kpi-value { font-size: 22px; margin: 4px 0; }
html[data-density="compact"] .content { padding: 14px 18px 36px; }

/* R4.5 顶栏子菜单：会员未读红点 / 外链角标 */
.gdi-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: auto; flex-shrink: 0; }
.gdi-ext { margin-left: auto; font-size: 11px; opacity: .55; flex-shrink: 0; }

/* ============ 7. 顶栏搜索居中 + 主流程快捷导航（2026-11-05 R4.6） ============ */
/* 搜索框水平居中：占满品牌/菜单与右侧图标区之间的剩余空间 */
.gnav-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.gnav .gnav-center .topbar-search { width: min(420px, 100%); }
.gnav .gnav-center .topbar-search input { width: 100%; }

/* 主流程快捷导航（装配式设计器 / 设计管理 / 生产管理 / 发货管理 / 工作汇报） */
/* ★ 2026-11-06 重设计（用户要求：图标别太单调、太小，重新考虑比例与配色）：
   emoji 彩色芯片（每项专属色、rgba 底深浅主题通用）+ 加大字号与间距 */
.flow-nav { display: flex; align-items: center; gap: 2px; margin-right: 6px; flex-shrink: 0; }
.flow-nav .fnav-link {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px;
  border-radius: 10px; font-size: 13.5px; color: var(--text); cursor: pointer;
  white-space: nowrap; user-select: none; transition: background .15s, color .15s;
}
.flow-nav .fnav-link:hover { background: var(--fill); }
.flow-nav .fnav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.flow-nav .fnav-ic {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
}
.flow-nav .fnav-ic.c-blue   { background: rgba(59, 130, 246, .16); }
.flow-nav .fnav-ic.c-orange { background: rgba(249, 115, 22, .18); }
.flow-nav .fnav-ic.c-green  { background: rgba(16, 185, 129, .18); }
.flow-nav .fnav-ic.c-purple { background: rgba(139, 92, 246, .18); }
/* 装配式设计器：渐变芯片 + 主色文字，全排里最显眼 */
/* 2026-11-06：accent 项图标与文字颜色分离（用户反馈「糊一起了」）：
   图标 = 白色菱形落在蓝紫渐变芯片上（清晰锐利），文字 = 正文色加粗（不再全紫一片） */
.flow-nav .fnav-accent { color: var(--text); font-weight: 700; }
.flow-nav .fnav-accent .fnav-ic { background: linear-gradient(135deg, #3B82F6, #8B5CF6); color: #fff; }
.flow-nav .fnav-accent:hover { background: var(--primary-soft); }

@media (max-width: 1360px) {
  .gnav .gnav-center .topbar-search { width: min(300px, 100%); }
  .flow-nav .fnav-link { padding: 0 9px; }
}
@media (max-width: 1120px) {
  .gnav-center { display: none; }
}
@media (max-width: 900px) {
  .flow-nav { display: none; }
}

/* ============ 8. 看板科技感 Hero「驾驶舱」（2026-11-05 R5.4 重设计） ============ */
/* 结构：.ht > 装饰层(::before 网格 / ::after 斜纹) + .ht-scan 扫描线 + 4 个 HUD 角标
         + .ht-l(徽章/英文标语/渐变标题/副题/胶囊/KPI 内嵌) + .ht-r(辉光进度环) */
.ht {
  --ht-accent: #5EEAD4; --ht-accent2: #818CF8;
  position: relative; overflow: hidden; border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 30px; margin-bottom: 16px;
  color: #E8EEF6;
  background:
    radial-gradient(1100px 300px at 0% -80%, var(--ht-glow1, rgba(34, 211, 238, .20)), transparent 60%),
    radial-gradient(900px 320px at 88% -70%, var(--ht-glow2, rgba(129, 140, 248, .28)), transparent 62%),
    radial-gradient(640px 260px at 55% 130%, var(--ht-glow3, rgba(167, 139, 250, .15)), transparent 70%),
    linear-gradient(130deg, var(--ht-bg1, #0B1120) 0%, var(--ht-bg2, #0E1630) 48%, var(--ht-bg3, #101A3C) 100%);
  box-shadow: 0 10px 30px rgba(2, 8, 24, .30), inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* 综合指挥舱：深空蓝紫 + 青色主辉光 */
.ht--global { --ht-glow1: rgba(34, 211, 238, .22); --ht-glow2: rgba(129, 140, 248, .30); --ht-glow3: rgba(167, 139, 250, .16);
  --ht-bg1: #0B1120; --ht-bg2: #0E1630; --ht-bg3: #111B3E; }
/* 设计档：靛紫星云 */
.ht--design { --ht-glow1: rgba(167, 139, 250, .26); --ht-glow2: rgba(56, 189, 248, .18); --ht-glow3: rgba(244, 114, 182, .14);
  --ht-bg1: #14102A; --ht-bg2: #171238; --ht-bg3: #1A1442; --ht-accent: #C4B5FD; --ht-accent2: #F472B6; }
/* 生产档：青蓝机体 */
.ht--prod { --ht-glow1: rgba(34, 211, 238, .24); --ht-glow2: rgba(16, 185, 129, .18); --ht-glow3: rgba(59, 130, 246, .16);
  --ht-bg1: #0A1B24; --ht-bg2: #0A2130; --ht-bg3: #0C2A38; --ht-accent: #67E8F9; --ht-accent2: #34D399; }
/* 销售档：暖橙经营 */
.ht--sales { --ht-glow1: rgba(251, 146, 60, .24); --ht-glow2: rgba(129, 140, 248, .20); --ht-glow3: rgba(251, 191, 36, .12);
  --ht-bg1: #20140C; --ht-bg2: #26170E; --ht-bg3: #1D1730; --ht-accent: #FDBA74; --ht-accent2: #FBBF24; }

/* 网格底纹（上重下淡） */
.ht::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(148, 180, 210, .06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148, 180, 210, .06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 85%);
}
/* 右上角斜向装饰条纹 */
.ht::after {
  content: ""; position: absolute; top: -46px; right: -36px; width: 360px; height: 160px;
  background: repeating-linear-gradient(115deg, color-mix(in srgb, var(--ht-accent) 14%, transparent) 0 2px, transparent 2px 18px);
  transform: skewX(-18deg); pointer-events: none;
}
/* 扫描线：缓慢下滑的光带 */
.ht-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 170px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--ht-glow1, rgba(34, 211, 238, .2)), transparent);
  opacity: .32; animation: htScan 8s linear infinite;
}
@keyframes htScan { from { transform: translateY(-190px); } to { transform: translateY(430px); } }
@media (prefers-reduced-motion: reduce) { .ht-scan { animation: none; } }

/* HUD 四角标 */
.ht-corner { position: absolute; width: 16px; height: 16px; color: var(--ht-accent); opacity: .55; pointer-events: none; }
.ht-c1 { top: 10px; left: 10px; border-top: 2px solid; border-left: 2px solid; border-top-left-radius: 4px; }
.ht-c2 { top: 10px; right: 10px; border-top: 2px solid; border-right: 2px solid; border-top-right-radius: 4px; }
.ht-c3 { bottom: 10px; left: 10px; border-bottom: 2px solid; border-left: 2px solid; border-bottom-left-radius: 4px; }
.ht-c4 { bottom: 10px; right: 10px; border-bottom: 2px solid; border-right: 2px solid; border-bottom-right-radius: 4px; }

.ht-l { position: relative; z-index: 1; min-width: 0; flex: 1; }
.ht-trow { display: flex; align-items: center; gap: 12px; }
.ht-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 10px; letter-spacing: 2.5px; font-weight: 700;
  color: var(--ht-accent); border: 1px solid currentColor; background: rgba(148, 180, 210, .07);
}
.ht-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: htPulse 2s ease-in-out infinite; }
@keyframes htPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; box-shadow: 0 0 8px currentColor; } }
.ht-en { font-size: 10.5px; letter-spacing: 3px; font-weight: 600; color: rgba(148, 163, 184, .55); }
/* 渐变大标题（雅黑优先，粗体渲染见 style.css 注释） */
.ht-title {
  font-size: 26px; font-weight: 700; letter-spacing: 1.5px; line-height: 1.25; margin-top: 10px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Inter", sans-serif;
  background: linear-gradient(92deg, #FFFFFF 30%, var(--ht-accent) 72%, var(--ht-accent2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #F8FAFC;
}
.ht-sub { color: #9FB1C9; font-size: 12.5px; letter-spacing: .3px; margin-top: 7px; line-height: 1.7; }
.ht-sub b { color: #DCE7F3; font-weight: 700; }

/* 内嵌 KPI：竖分隔线驾驶舱排布 */
.ht-stats { display: flex; flex-wrap: wrap; row-gap: 16px; margin-top: 20px; }
.ht-stat { padding: 0 30px; border-left: 1px solid rgba(148, 163, 184, .16); }
.ht-stat:first-child { padding-left: 2px; border-left: 0; }
.ht-stat:last-child { padding-right: 2px; }
.ht-stat-v { font-size: 21px; font-weight: 800; color: #F8FAFC; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.ht-stat-v.hl {
  background: linear-gradient(90deg, #7DD3FC, var(--ht-accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ht-stat-v.warn { color: #FCA5A5; }
.ht-stat-l { font-size: 11.5px; color: #8FA3BD; margin-top: 4px; letter-spacing: 1px; }
.ht-stat-n { font-size: 10.5px; color: #64748B; margin-top: 2px; }
.ht-stat-n:empty { display: none; }

.ht-r { position: relative; z-index: 1; flex-shrink: 0; }
.ht-ring svg { display: block; filter: drop-shadow(0 0 16px rgba(56, 189, 248, .35)); }

@media (max-width: 900px) {
  .ht { flex-wrap: wrap; }
  .ht-stat { padding: 0 18px; }
  .ht-stat-v { font-size: 17px; }
}

/* hero 内状态胶囊：关键指标一排带光点的药丸 */
.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.dash-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px;
  border-radius: 999px; font-size: 11.5px; color: #C9D7E8;
  background: rgba(148, 180, 210, .10); border: 1px solid rgba(148, 180, 210, .20);
}
.dash-chip b { color: #FFFFFF; font-size: 12.5px; font-weight: 700; }
.dash-chip i { font-style: normal; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* KPI 卡片科技化：顶部渐变光带 + 悬停微浮 */
.kpi { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), rgba(34, 211, 238, .6) 55%, transparent 90%);
  opacity: .6;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, .12); }
/* 卡片标题 accent 竖条 */
.card-title::before {
  content: ""; display: inline-block; width: 3px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #22D3EE);
  margin-right: 7px; vertical-align: -1.5px;
}

/* ============ 9. 深色数据可视化区「驾驶舱下仪表带」（2026-11-05 R5.5） ============ */
/* 与 hero 同一渐变语系：深蓝紫底 + 青/靛辉光 + 网格。
   关键手法：在 .ht-zone 上重定义 --text/--muted/--sub/--line/--card/--primary 等
   设计令牌 —— 区内所有卡片和内联 SVG 图表（fill:var(--text) 等）自动翻成深色主题配色，
   无需改动任何图表代码。 */
.ht-zone {
  --text: #E6EDF7; --muted: #9FB1C9; --sub: #7C90AC;
  --line: rgba(148, 180, 210, .16); --line-soft: rgba(148, 180, 210, .10);
  --card: rgba(17, 27, 48, .72); --fill: rgba(148, 180, 210, .12);
  --primary: #38BDF8; --primary-soft: rgba(56, 189, 248, .16); --primary-d: #0EA5E9;
  --ok: #34D399; --warn: #FBBF24; --danger: #F87171;
  position: relative; overflow: hidden; border-radius: 14px;
  padding: 16px 16px 6px; margin-bottom: 16px;
  background:
    radial-gradient(900px 240px at 0% -60%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(820px 260px at 100% -60%, rgba(129, 140, 248, .15), transparent 62%),
    linear-gradient(150deg, #0C1322 0%, #0F1932 55%, #0C1226 100%);
  box-shadow: 0 8px 24px rgba(2, 8, 24, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.ht-zone::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(148, 180, 210, .05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148, 180, 210, .05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 88%);
}
/* 区块头：DATA-VIZ 徽章 + 标题 + 渐隐延伸线 */
.htz-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 0 2px 14px; }
.htz-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px;
  border-radius: 999px; font-size: 9.5px; letter-spacing: 2.5px; font-weight: 700;
  color: #5EEAD4; border: 1px solid rgba(94, 234, 212, .4); background: rgba(94, 234, 212, .07);
}
.htz-tag i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: htPulse 2s ease-in-out infinite; }
.htz-title { font-size: 12.5px; font-weight: 700; color: #C9D7E8; letter-spacing: 2px; }
.htz-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(94, 234, 212, .35), rgba(129, 140, 248, .2), transparent); }
.htz-row { margin-top: 14px; position: relative; z-index: 1; }
.ht-zone .grid-2 { position: relative; z-index: 1; }

/* 区内卡片：玻璃质感 + 悬停霓虹描边 */
.ht-zone .card {
  background: var(--card);
  border: 1px solid rgba(148, 180, 210, .16);
  box-shadow: 0 2px 10px rgba(2, 8, 24, .25);
  transition: border-color .15s, box-shadow .15s;
}
.ht-zone .card:hover {
  border-color: rgba(56, 189, 248, .45);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .22), 0 6px 20px rgba(2, 8, 24, .45);
}
.ht-zone .card-title { color: #E6EDF7; }
.ht-zone .card-link { color: #7DD3FC; }
.ht-zone .empty { color: #64748B; }
/* 热力格：原 style.css 硬编码白底，深色区翻成玻璃格 */
.ht-zone .heat-cell { background: rgba(148, 180, 210, .06); border-color: rgba(148, 180, 210, .14); }
.ht-zone .heat-nm { color: var(--muted); }
/* 环形图中心文字 / 图例 */
.ht-zone .dlegend-name { color: var(--muted); }

/* 深色区内 KPI/表格如出现也自动适配（变量已重定义） */

/* ============ 10. 工作台「驾驶舱」紧凑三栏版（2026-11-06 R6.0） ============ */
/* 用户需求：① 看板整体紧凑、字体缩小2号 ② 版面参考 board/index.html 生产驾驶舱
   （顶栏 KPI 计数条 + 左中右三栏 + 底部表格带）。
   全部规则收敛在 .cockpit 容器内，不影响其它页面。 */

.cockpit .page-head { margin-bottom: 10px; }
.cockpit .page-title-lg { font-size: 17px; }
.cockpit .page-sub { font-size: 10.5px; margin-top: 3px; }

/* —— Hero 紧凑化 —— */
.cockpit .ht { padding: 12px 18px 11px; margin-bottom: 10px; gap: 18px; }
.cockpit .ht-title { font-size: 19px; margin-top: 5px; letter-spacing: 1px; }
.cockpit .ht-sub { font-size: 10.5px; margin-top: 3px; }
.cockpit .ht-en { font-size: 9px; letter-spacing: 2px; }
.cockpit .ht-badge { font-size: 9px; padding: 2px 8px; letter-spacing: 1.5px; }
.cockpit .ht-stats { margin-top: 8px; row-gap: 6px; }
.cockpit .ht-stat { padding: 0 16px; }
.cockpit .ht-stat-v { font-size: 16px; }
.cockpit .ht-stat-l { font-size: 9.5px; margin-top: 2px; }
.cockpit .ht-stat-n { font-size: 9px; margin-top: 1px; }
.cockpit .ht-ring svg { width: 76px; height: 76px; }
.cockpit .ht-ring svg text { font-size: 19px; }
.cockpit .dash-chips { margin-top: 8px; gap: 6px; }
.cockpit .dash-chip { height: 22px; font-size: 10.5px; padding: 0 9px; gap: 5px; }
.cockpit .dash-chip b { font-size: 11px; }

/* —— 三栏驾驶舱主体（左：漏斗+进度 / 中：大图+热力 / 右：营收+库存） —— */
.cockpit .ht-zone { padding: 12px 12px 10px; margin-bottom: 10px; }
.cockpit .htz-head { padding: 0 2px 10px; gap: 10px; }
.cockpit .htz-title { font-size: 11px; letter-spacing: 1.5px; }
.ck-main { display: grid; grid-template-columns: minmax(265px, 320px) minmax(0, 1fr) minmax(265px, 320px);
  gap: 10px; align-items: start; margin-top: 2px; position: relative; z-index: 1; }
.ck-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ck-col > .card { margin-top: 0; }
@media (max-width: 1280px) {
  .ck-main { grid-template-columns: 1fr 1fr; }
  .ck-col--c { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 860px) {
  .ck-main { grid-template-columns: 1fr; }
  .ck-col--c { grid-column: auto; order: 0; }
}

/* —— 自定义底行：最新订单(宽) + Top6(窄)，类名避开 layout.js 的 grid-2 拆分 —— */
.ck-row { display: grid; gap: 10px; margin-top: 10px; }
.ck-row > .card { margin-top: 0; }
.ck-row-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .ck-row-main { grid-template-columns: 1fr; } }

/* —— 卡片紧凑（字体 -2 号） —— */
.cockpit .card + .card { margin-top: 10px; }
.cockpit .card-head { padding: 7px 11px; gap: 7px; }
.cockpit .card-title { font-size: 11.5px; }
.cockpit .card-title::before { height: 10px; margin-right: 6px; }
.cockpit .card-body { padding: 9px 11px; }
.cockpit .card-link { font-size: 10.5px; }
.cockpit .dash-row { margin-top: 10px; }
.cockpit .grid-2, .cockpit .grid-3 { gap: 10px; }
.cockpit .empty { font-size: 11.5px; }

/* KPI 卡（销售/设计/生产档使用） */
.cockpit .kpi-grid { gap: 10px; margin-bottom: 10px; }
.cockpit .kpi { padding: 9px 12px; }
.cockpit .kpi-value { font-size: 20px; margin: 3px 0 2px; }
.cockpit .kpi-label { font-size: 10.5px; }
.cockpit .kpi-note { font-size: 10px; margin-top: 0; }

/* 表格紧凑 */
.cockpit .table-wrap table { font-size: 12px; }
.cockpit th, .cockpit td { padding: 6px 10px; }
.cockpit .td-sub { font-size: 10.5px; }

/* 小统计 / 列表 / 图例 */
.cockpit .mini-stat { padding: 5px 0; font-size: 11px; }
.cockpit .mini-stat b { font-size: 14.5px; }
.cockpit .sub-title { font-size: 11px; margin-bottom: 4px; }
.cockpit .blist-row { padding: 5px 0; font-size: 11.5px; }
.cockpit .blist-tag { font-size: 10.5px; }
.cockpit .stock-row { padding: 4px 0; font-size: 11.5px; }
.cockpit .stock-name { width: 70px; }
.cockpit .dwrap { gap: 12px; }
.cockpit .dlegend-row { padding: 3px 0; font-size: 11.5px; }
.cockpit .dlegend-pct { font-size: 10.5px; width: 46px; }
.cockpit .heat { gap: 6px; }
.cockpit .heat-cell { padding: 6px 7px 5px; border-radius: 7px; }
.cockpit .heat-ic { font-size: 13px; }
.cockpit .heat-nm { font-size: 10px; margin: 3px 0 4px; height: 24px; }
.cockpit .heat-vl { font-size: 9.5px; margin-top: 3px; }

/* ============ 11. R6.2 微调（2026-11-06 15:23） ============ */
/* ① 左右两侧栏（漏斗/设计/发货/营收/库存）字号再加大 2 号 */
.cockpit .ck-col .card-title { font-size: 14px; }
.cockpit .ck-col .card-link { font-size: 13px; }
.cockpit .ck-col .mini-stat { font-size: 14px; padding: 7px 0; }
.cockpit .ck-col .mini-stat b { font-size: 17.5px; }
.cockpit .ck-col .dlegend-row { font-size: 14.5px; }
.cockpit .ck-col .dlegend-pct { font-size: 13.5px; width: 56px; }
.cockpit .ck-col .stock-row { font-size: 14.5px; }
.cockpit .ck-col .stock-name { width: 84px; }
.cockpit .ck-col .blist-row { font-size: 14.5px; }
.cockpit .ck-col .empty { font-size: 14.5px; }

/* ② 生产流程节点热力：12 节点 8+4 不对称 → 改 6 列（6+6 对称不留空），字号 +2 */
.cockpit .heat { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cockpit .heat-cell { padding: 9px 10px 8px; }
.cockpit .heat-ic { font-size: 15px; }
.cockpit .heat-nm { font-size: 12px; height: 30px; }
.cockpit .heat-vl { font-size: 11.5px; margin-top: 4px; }

/* ③ 底部明细带（ht-zone--foot）字号加大 2 号 */
.cockpit .ht-zone--foot { padding: 12px 12px 10px; }
.ht-zone--foot .card-title { font-size: 14px; }
.ht-zone--foot .card-link { font-size: 13px; }
.ht-zone--foot .table-wrap table { font-size: 15px; }
.ht-zone--foot th, .ht-zone--foot td { padding: 8px 12px; }
.ht-zone--foot th { background: rgba(148, 180, 210, .07); }
.ht-zone--foot tbody tr:hover td { background: rgba(148, 180, 210, .05); }
.ht-zone--foot .td-sub { font-size: 13.5px; }
.ht-zone--foot .sub-title { font-size: 14px; margin-bottom: 8px; }
.ht-zone--foot .blist-row { font-size: 14.5px; padding: 7px 0; }
.ht-zone--foot .blist-tag { font-size: 13px; }
.ht-zone--foot .empty { font-size: 14.5px; }
.ht-zone--foot .badge { font-size: 13.5px; }
/* 徽章：深色区专用——玻璃暗底 + 亮字（.cockpit 前缀提高优先级，
   压过 html[data-theme=dark] 与 style.css 的浅色底深字规则） */
.cockpit .ht-zone--foot .badge-gray   { background: rgba(165, 180, 207, .14); color: #A5B4CF; }
.cockpit .ht-zone--foot .badge-blue   { background: rgba(125, 211, 252, .14); color: #7DD3FC; }
.cockpit .ht-zone--foot .badge-green  { background: rgba(110, 231, 183, .14); color: #6EE7B7; }
.cockpit .ht-zone--foot .badge-yellow { background: rgba(252, 211, 77, .15);  color: #FCD34D; }
.cockpit .ht-zone--foot .badge-red    { background: rgba(252, 165, 165, .14); color: #FCA5A5; }
.cockpit .ht-zone--foot .badge-purple { background: rgba(196, 181, 253, .14); color: #C4B5FD; }

/* R6.4：面包屑行右侧常驻「新建客户/新建订单」按钮 */
.crumb .qc-crumb { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; }
.crumb .qc-crumb .btn { padding: 4px 12px; font-size: 12px; white-space: nowrap; }
