/* ============================================================
   ★ 2026-11-19 侧边栏改版样式（预览v6定稿版落地）
   布局：左侧澜绿窄条承载全部菜单（默认折叠组），顶栏瘦身为浅色。
   颜色：全部取自现有顶栏令牌（澜绿 #6E56CF→#E37222、金 #F0A468/#F7D9B0、
         金色高亮 rgba(185,138,107,.28)/#F0B27A、浅顶栏 #F2F0EC、关澜橙主钮 #E37222）。
   折叠唯一真源：.side-grp 的 open 类（CSS 控制显隐，JS 只切类）。
   ============================================================ */

/* ---------- 骨架：app 改两栏 ----------
   ⚠ 本表在 theme.css 之后加载但同特异性会被后者按源序覆盖
   （theme.css:53 .app{flex-direction:column;height:100vh;overflow:hidden}）——
   全部加 html 前缀提升特异性，保证横向两栏生效。 */
html .app, html body .app {
  display: flex; flex-direction: row;
  height: 100vh; overflow: hidden;
  min-height: 0;
}
html body .app .main-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}
html body .app .main-col .content { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
html body .app .main-col .crumb { flex-shrink: 0; }

/* ---------- 左侧边栏 ---------- */
.side-nav {
  width: 196px; flex-shrink: 0;
  /* ★ 2026-11-30（用户）：侧栏换 VI v4.1 白砖浅砂 —— 白底暖灰描边，不再是澜绿 */
  background: #241F3D;
  border-right: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0; z-index: 40;
  overflow-y: auto; overflow-x: hidden;
}
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 2px; }
/* 2px 金色渐变装饰条：右侧竖向，上中下三段分割（老板 2026-12-04 指令，原顶沿横条改此） */
.side-nav .side-gold { position: absolute; right: 0; top: 0; bottom: 0; width: 2px; height: auto; flex-shrink: 0; background: linear-gradient(180deg, #FFD37A 0%, #FFB020 14%, #FFD37A 30%, #B9AEE8 33%, #6E56CF 50%, #B9AEE8 66%, #FFD37A 70%, #FFB020 86%, #FFD37A 100%); }
.side-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  cursor: pointer; user-select: none;
}
.side-brand .brand-mark {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  background: #E37222; color: #fff;   /* ★ v4.1=砖红实填（logo 允许实填）；深色主题见 kb-dark 覆盖为按钮黄 #E37222 */
  font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.side-brand-t { font-size: 14.5px; font-weight: 700; color: #fff; letter-spacing: .5px; white-space: nowrap; }
.side-brand-t b { color: #66B8BF; font-weight: 800; }

/* 分组 */
.side-grp { padding: 4px 0 2px; }
.side-grp-t {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px 5px; margin: 0 6px; border-radius: 8px;
  font-size: 15px; font-weight: 700; letter-spacing: .5px;
  color: #fff; cursor: pointer; user-select: none; white-space: nowrap;
}
.side-grp-t:hover { background: rgba(255,255,255,.08); color: #fff; }
/* ★ 2026-11-30（用户）：英文分组名 + 中文功能副标签；★ 2026-12-01（用户·下午定稿）：
   反过来——英文加大加粗做主标题，旁边中文缩小做副标题 */
.side-grp-abbr { font-size: 16px; font-weight: 800; letter-spacing: 1.5px; }
.side-grp-sub { margin-left: 7px; font-size: 11.5px; font-weight: 400; letter-spacing: .3px; color: rgba(255,255,255,.55); }
.side-grp-t:hover .side-grp-sub { color: #fff; }
.side-grp-t .arr { font-size: 9px; transition: transform .15s; color: rgba(255,255,255,.45); }
/* ★ 2026-11-23（用户）：总览组标题=工作台直达链接（点文字跳工作台，点右侧箭头才是折叠） */
.side-grp-t.side-grp-link .arr { padding: 3px 5px; border-radius: 5px; }
.side-grp-t.side-grp-link .arr:hover { background: rgba(255,255,255,.12); color: #fff; }
.side-grp.open .side-grp-t .arr { transform: rotate(90deg); }

/* 功能项：折叠唯一真源 = 组的 open 类 */
.side-grp .side-item { display: none; }
.side-grp.open .side-item { display: flex; }
.side-item {
  align-items: center; gap: 8px;
  padding: 7.5px 14px 7.5px 20px; margin: 0 6px; border-radius: 8px;
  font-size: 15px; font-weight: 400; color: rgba(255,255,255,.78);
  cursor: pointer; position: relative; white-space: nowrap; overflow: hidden;
}
/* ★ 2026-12-01（用户）：展开后的菜单项一律标准字重，不加粗（仅分组标题加粗） */
.side-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-item.active {
  background: #6E56CF; color: #fff; font-weight: 400;
}
.side-item.active::before {
  content: ""; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; border-radius: 0 3px 3px 0; background: #9B85FF;
}
.side-item .ic { width: 17px; text-align: center; font-size: 13.5px; flex-shrink: 0; opacity: .92; }
.side-item .si-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-item .ext { font-size: 10px; color: rgba(255,255,255,.5); flex-shrink: 0; }
.side-item .gdi-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #E05252; flex-shrink: 0;
}
.side-foot {
  margin-top: auto; padding: 11px 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 10.5px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden;
}

/* ---------- 顶栏瘦身（浅色 = 正文同底） ----------
   ⚠ theme.css .gnav 规则同特异性，全部加 html body .app 前缀压制 */
html body .app .gnav {
  height: 54px; flex-shrink: 0;
  background: #F2F0EC;
  border-bottom: 1px solid #E3DFD8;
  box-shadow: none;
  padding: 0 16px; gap: 12px;
}
/* 旧金条/澜绿渐变装饰全部让位（装饰已在侧栏顶） */
html[data-v2="on"] .gnav::before { display: none; }
html[data-v2="on"] .gnav { background: #F2F0EC; border-bottom-color: transparent; }

.gnav .gnav-center { flex: 0 1 340px; margin: 0; }
.gnav .topbar-search {
  background: #fff; border: 1px solid #E3DFD8; border-radius: 10px;
}
.gnav .topbar-search .ts-icon { color: #9AA8B8; }
.gnav .topbar-search input { color: #31435A; }
.gnav .topbar-search input::placeholder { color: #9AA8B8; }
.gnav .icon-btn { color: #3D5170; }
.gnav .icon-btn:hover { background: #EEEAFE; color: #6E56CF; }

/* 快捷导航按钮（浅色胶囊）
   ★ 2026-11-19（用户指令"按钮不明显，加线框"）：加粗澜绿线框+字重加深。
   ⚠ 必须带 html 前缀 + !important——线上 v2-guanlan.d15.css 的
     html[data-v2=on] 前缀特异性更高会盖掉无前缀规则（实证踩坑）。 */
/* ★ 2026-11-19（用户指令四连）：①按钮细字体 ②去底色只留浅线框
   ③深浅主题各自跟随正文底 ④侧栏澜绿只在浅色主题用，深色主题用右侧深底+金色分割线 */
html .flow-nav .fnav-link {
  background: transparent !important; border: 1px solid #D8DEE6 !important;
  color: #6E56CF !important; font-weight: 400;
}
html .flow-nav .fnav-link:hover { background: #EEEAFE !important; border-color: #D8D2F8 !important; color: #6E56CF !important; }
html .flow-nav .fnav-link.active { background: #EEEAFE !important; border-color: #D8D2F8 !important; color: #6E56CF !important; }
/* 深色主题（kb-dark）：按钮融深底、浅字浅框 */
html body .app.kb-dark .flow-nav .fnav-link,
html.kb-dark .flow-nav .fnav-link {
  background: transparent !important; border-color: rgba(255,255,255,.22) !important; color: rgba(255,255,255,.85) !important;
}
html body .app.kb-dark .flow-nav .fnav-link:hover,
html.kb-dark .flow-nav .fnav-link:hover { background: rgba(255,255,255,.10) !important; border-color: rgba(255,255,255,.40) !important; color: #fff !important; }
html body .app.kb-dark .flow-nav .fnav-link.active,
html.kb-dark .flow-nav .fnav-link.active { background: rgba(255,255,255,.10) !important; border-color: rgba(255,255,255,.40) !important; color: #fff !important; }
/* 主按钮「装配式设计器」：两主题都保留实底（识别锚点） */
html .flow-nav .fnav-accent,
html body .app.kb-dark .flow-nav .fnav-accent,
html[data-v2="on"] .flow-nav .fnav-accent {
  background: #E37222 !important; border-color: #E37222 !important; color: #fff !important; font-weight: 700;
}
html .flow-nav .fnav-accent:hover,
html body .app.kb-dark .flow-nav .fnav-accent:hover,
html[data-v2="on"] .flow-nav .fnav-accent:hover { background: #c9611a !important; border-color: #c9611a !important; color: #fff !important; }

/* 深色主题下顶栏整体融右侧深底、搜索框去黑底 */
html body .app.kb-dark .gnav,
html.kb-dark .gnav { background: transparent !important; border-bottom-color: rgba(255,255,255,.10) !important; }
html body .app.kb-dark .gnav .topbar-search,
html.kb-dark .gnav .topbar-search { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.18) !important; }
html body .app.kb-dark .gnav .topbar-search input,
html.kb-dark .gnav .topbar-search input { color: rgba(255,255,255,.88) !important; }
html body .app.kb-dark .gnav .topbar-search input::placeholder,
html.kb-dark .gnav .topbar-search input::placeholder { color: rgba(255,255,255,.45) !important; }
html body .app.kb-dark .gnav .uchip,
html.kb-dark .gnav .uchip { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.18) !important; }
html body .app.kb-dark .gnav .uchip .user-name,
html.kb-dark .gnav .uchip .user-name { color: rgba(255,255,255,.88) !important; }

/* ---------- 侧边栏主题联动 ----------
   浅色主题：澜绿窄条（默认样式不变）
   深色主题（kb-dark）：侧栏改用右侧深色系 + 顶部金色渐变分割线 */
html body .app.kb-dark .side-nav,
html.kb-dark .side-nav {
  background: linear-gradient(180deg, #241F3D, #332B66);
}
html body .app.kb-dark .side-nav .side-gold,
html.kb-dark .side-nav .side-gold {
  width: 2px; height: auto;
  background: linear-gradient(180deg, #F0B27A 0%, #F0A468 14%, #F0B27A 30%, #B9AEE8 33%, #9B85FF 50%, #B9AEE8 66%, #F0B27A 70%, #F0A468 86%, #F0B27A 100%);
}
html body .app.kb-dark .side-nav .side-brand,
html.kb-dark .side-nav .side-brand { border-bottom-color: rgba(255,255,255,.10); }
/* ★ 2026-11-19 LOGO配色（用户指令）：深色主题=按钮黄 #E37222，浅色主题=澜绿 #6E56CF（默认规则48行） */
html body .app.kb-dark .side-nav .side-brand .brand-mark,
html.kb-dark .side-nav .side-brand .brand-mark { background: #E37222; }
html body .app.kb-dark .side-nav .side-brand-t b,
html.kb-dark .side-nav .side-brand-t b { color: #F7D9B0; }
html body .app.kb-dark .side-nav .side-grp-t,
html.kb-dark .side-nav .side-grp-t { color: rgba(255,255,255,.55); }
html body .app.kb-dark .side-nav .side-grp-t:hover,
html.kb-dark .side-nav .side-grp-t:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
html body .app.kb-dark .side-nav .side-item { color: rgba(255,255,255,.78); }
html body .app.kb-dark .side-nav .side-item:hover { background: rgba(255,255,255,.08); color: #fff; }
html body .app.kb-dark .side-nav .side-item.active,
html.kb-dark .side-nav .side-item.active {
  background: rgba(185,138,107,.18); color: #F0B27A;
}
html body .app.kb-dark .side-nav .side-item.active::before,
html.kb-dark .side-nav .side-item.active::before { background: #B9AEE8; }
html body .app.kb-dark .side-nav .side-foot,
html.kb-dark .side-nav .side-foot { border-top-color: rgba(255,255,255,.10); color: rgba(255,255,255,.40); }

/* 账号胶囊（浅色） */
.gnav .uchip { background: #fff; border: 1px solid #E3DFD8; }
.gnav .uchip .user-name { color: #31435A; }
.gnav .uchip .user-role { color: #7C8EA3; }
.gnav .uchip .avatar { background: #6E56CF; color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .side-nav { width: 180px; }
}
@media (max-width: 860px) {
  /* 小屏：侧栏改为抽屉（默认藏，menuBtn 呼出） */
  .side-nav {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .2s;
    box-shadow: 6px 0 24px rgba(23,61,53,.35);
  }
  body.side-open .side-nav { transform: translateX(0); }
  .app .menu-btn.hidden { display: none; }
  .app .menu-btn { display: inline-flex; }
}

/* ---------- 打印：侧栏不输出 ---------- */
@media print {
  .side-nav { display: none !important; }
  .app { display: block !important; }
}

/* —— 2026-11-30 v4.1 浅色改造后，kb-dark 补充覆盖（浅色基础层变白底，暗色下这几处要回到暗色可读色）—— */
html body .app.kb-dark .side-nav .side-grp-sub,
html.kb-dark .side-nav .side-grp-sub { color: rgba(240, 224, 205, .92); }
html body .app.kb-dark .side-nav::-webkit-scrollbar-thumb,
html.kb-dark .side-nav::-webkit-scrollbar-thumb { background: #2A3040; }
html body .app.kb-dark .side-nav .side-item .ext,
html.kb-dark .side-nav .side-item .ext { color: #D8D2F8; }
