/* ==========================================================================
   cSCEc UI Web V2.0 页面框架与栅格布局样式表
   覆盖：系统框架（上下/左右布局）、官网展示框架、登录页、24栅格、左树右表/卡、自定义滚动条
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--cscec-font-family);
  font-size: var(--cscec-font-s2);
  line-height: var(--cscec-lh-s2);
  color: var(--cscec-font-base-color);
  background-color: var(--cscec-bg-base-color);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cscec-primary-color);
  text-decoration: none;
}

a:not(.cscec-btn):hover {
  color: var(--cscec-primary-color-hover);
}

/* --------------------------------------------------------------------------
   1. 自定义滚动条（默认隐藏，悬停区域显现：小6px / 中8px / 大12px）
   -------------------------------------------------------------------------- */
.cscec-scroll,
.cscec-scroll-sm,
.cscec-scroll-lg {
  overflow: auto;
  scrollbar-gutter: stable;
}

.cscec-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.cscec-scroll-sm::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.cscec-scroll-lg::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.cscec-scroll::-webkit-scrollbar-track,
.cscec-scroll-sm::-webkit-scrollbar-track,
.cscec-scroll-lg::-webkit-scrollbar-track {
  background: transparent;
}

.cscec-scroll::-webkit-scrollbar-thumb,
.cscec-scroll-sm::-webkit-scrollbar-thumb,
.cscec-scroll-lg::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: var(--cscec-radius-md);
}

.cscec-scroll:hover::-webkit-scrollbar-thumb,
.cscec-scroll-sm:hover::-webkit-scrollbar-thumb,
.cscec-scroll-lg:hover::-webkit-scrollbar-thumb {
  background: var(--cscec-border-color);
}

.cscec-scroll::-webkit-scrollbar-thumb:hover,
.cscec-scroll-sm::-webkit-scrollbar-thumb:hover,
.cscec-scroll-lg::-webkit-scrollbar-thumb:hover {
  background: var(--cscec-scrollbar-hover-color);
}

/* --------------------------------------------------------------------------
   2. 后台管理系统框架（最小宽 1440px 兼容含滚动条视口，56px 顶部 + 200/64px 左侧菜单）
   -------------------------------------------------------------------------- */
.cscec-app-shell {
  min-width: 1440px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--cscec-bg-base-color);
}

@media (min-width: 1380px) {
  .cscec-app-shell {
    min-width: 100%;
  }
}

.cscec-header {
  position: sticky;
  top: 0;
  z-index: var(--cscec-z-header);
  height: var(--cscec-header-height);
  background: var(--cscec-bg-content-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--cscec-space-4x);
  box-shadow: var(--cscec-shadow-header);
}

.cscec-header-brand {
  display: flex;
  align-items: center;
  gap: var(--cscec-space-3x);
  min-width: 200px;
  flex-shrink: 0;
}

.cscec-header-logo-img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
}

.cscec-header-logo-mark {
  width: 36px;
  height: 36px;
  background: #0081cc;
  color: var(--cscec-font-white-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.cscec-header-title {
  font-size: var(--cscec-font-s6);
  line-height: var(--cscec-lh-s6);
  font-weight: 700;
  color: var(--cscec-font-base-color);
  white-space: nowrap;
}

.cscec-top-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  margin: 0 var(--cscec-space-8x) 0 var(--cscec-space-12x);
  overflow: hidden;
}

.cscec-top-nav-item {
  height: var(--cscec-header-height);
  padding: 0 var(--cscec-space-3x);
  display: inline-flex;
  align-items: center;
  gap: var(--cscec-space-2x);
  color: var(--cscec-font-base-color);
  font-size: var(--cscec-font-s3);
  line-height: var(--cscec-lh-s3);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.cscec-top-nav-item:hover {
  color: var(--cscec-primary-color);
  background: var(--cscec-bg-nav-hover);
}

.cscec-top-nav-item.is-active {
  color: var(--cscec-primary-color);
  background: var(--cscec-bg-nav-active);
  font-weight: 700;
  border-bottom-color: var(--cscec-primary-color);
}

.cscec-header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.cscec-header-icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: var(--cscec-radius-sm);
  border: none;
  background: transparent;
  color: var(--cscec-font-secondary-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cscec-header-icon-btn:hover {
  background: var(--cscec-bg-table-th-color);
  color: var(--cscec-primary-color);
}

.cscec-org-trigger {
  height: 32px;
  padding: 0 var(--cscec-space-2x);
  border: none;
  border-radius: var(--cscec-radius-sm);
  background: transparent;
  color: var(--cscec-font-base-color);
  display: inline-flex;
  align-items: center;
  gap: var(--cscec-space-2x);
  font-size: var(--cscec-font-s2);
  font-weight: 700;
  cursor: pointer;
}

.cscec-org-trigger:hover {
  color: var(--cscec-primary-color);
  background: var(--cscec-bg-nav-hover);
}

.cscec-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--cscec-space-2x);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--cscec-radius-sm);
}

.cscec-user-trigger:hover {
  background: var(--cscec-bg-table-th-color);
}

/* 主体区：左侧纯白导航 Left-Navigation + 右侧浅灰 #EDF1F5 工作区 */
.cscec-app-body {
  flex: 1;
  display: flex;
  min-height: calc(100vh - var(--cscec-header-height));
}

.cscec-sider {
  width: var(--cscec-sider-width);
  flex-shrink: 0;
  background: var(--cscec-bg-content-color);
  color: var(--cscec-font-base-color);
  border-right: 1px solid var(--cscec-line-color);
  padding: 0 0 var(--cscec-space-5x);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: width 0.2s ease;
  z-index: var(--cscec-z-sider);
}

.cscec-sider.is-collapsed {
  width: var(--cscec-sider-collapsed-width);
}

.cscec-sider-toggle-bar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
}

.cscec-sider.is-collapsed .cscec-sider-toggle-bar {
  justify-content: center;
  padding: 12px 0;
}

.cscec-sider-toggle {
  width: 24px;
  height: 24px;
  border-radius: var(--cscec-radius-sm);
  border: none;
  background: transparent;
  color: var(--cscec-font-secondary-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.15s;
}

.cscec-sider-toggle:hover {
  background: var(--cscec-bg-nav-hover);
}

.cscec-sider-toggle .icon-menu-open {
  display: none;
}

.cscec-sider.is-collapsed .cscec-sider-toggle .icon-menu-close {
  display: none;
}

.cscec-sider.is-collapsed .cscec-sider-toggle .icon-menu-open {
  display: inline-block;
}

.cscec-sider-menu {
  padding: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--cscec-space-2x);
}

.cscec-sider-item {
  height: 40px;
  padding: 0 var(--cscec-space-4x);
  margin: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: var(--cscec-space-2x);
  color: var(--cscec-font-base-color);
  font-size: var(--cscec-font-s2);
  line-height: var(--cscec-lh-s2);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.15s, color 0.15s;
}

.cscec-sider-item:hover {
  background: var(--cscec-bg-nav-hover);
  color: var(--cscec-primary-color);
}

.cscec-sider-item.is-active {
  background: var(--cscec-bg-nav-active);
  color: var(--cscec-primary-color);
  font-weight: 700;
}

.cscec-sider-item.has-active-child {
  background: transparent;
  color: var(--cscec-primary-color);
  font-weight: 700;
}

.cscec-sider-submenu {
  display: flex;
  flex-direction: column;
  gap: var(--cscec-space-2x);
}

.cscec-sider-submenu .cscec-sider-item {
  height: 40px;
  padding: 0 16px 0 44px;
  color: var(--cscec-font-secondary-color);
  font-size: var(--cscec-font-s2);
}

.cscec-sider-submenu .cscec-sider-item:hover {
  color: var(--cscec-primary-color);
}

.cscec-sider-submenu .cscec-sider-item.is-active {
  background: var(--cscec-bg-nav-active);
  color: var(--cscec-primary-color);
  font-weight: 700;
}

.cscec-sider.is-collapsed .cscec-sider-label,
.cscec-sider.is-collapsed .cscec-sider-submenu,
.cscec-sider.is-collapsed .cscec-sider-arrow {
  display: none;
}

.cscec-sider.is-collapsed .cscec-sider-item {
  justify-content: center;
  padding: 0;
}

.cscec-sider-footer {
  display: none;
}

/* 右侧工作区与标准白底卡片 */
.cscec-main-workspace {
  flex: 1;
  min-width: 0;
  padding: var(--cscec-space-5x);
  display: flex;
  flex-direction: column;
  gap: var(--cscec-space-4x);
}

/* 含右侧垂直居中悬浮锚点时预留通道（避免锚点遮挡右侧图表/卡片文字） */
.cscec-main-workspace.has-anchor {
  padding-right: 144px;
}

.cscec-page-card {
  background: var(--cscec-bg-content-color);
  border-radius: var(--cscec-radius-lg);
  padding: 0 var(--cscec-space-5x) var(--cscec-space-5x);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   3. 左树右表 / 左树右卡 分栏布局（对齐 Figma 3-开发平台模版-4-左树右卡）
   -------------------------------------------------------------------------- */
.cscec-split-layout {
  display: flex;
  gap: var(--cscec-space-5x);
  flex: 1;
  min-width: 0;
  min-height: 680px;
  position: relative;
}

.cscec-split-tree-pane {
  width: var(--cscec-tree-sider-width);
  min-width: 240px;
  max-width: 560px;
  flex-shrink: 0;
  border-right: 1px solid var(--cscec-line-color);
  padding: var(--cscec-space-3x) var(--cscec-space-5x) var(--cscec-space-5x) 0;
  display: flex;
  flex-direction: column;
  gap: var(--cscec-space-4x);
  position: relative;
  transition: width 0.2s ease, padding 0.2s ease;
}

.cscec-split-tree-pane.is-collapsed {
  width: 0 !important;
  min-width: 0;
  padding: 0;
  overflow: visible;
}

.cscec-split-tree-pane.is-collapsed > *:not(.cscec-tree-collapse-handle):not(.cscec-tree-resizer) {
  display: none;
}

.cscec-tree-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.cscec-tree-resizer:hover {
  background: var(--cscec-primary-color-20);
}

.cscec-tree-collapse-handle {
  position: absolute;
  top: 50%;
  right: -9px;
  transform: translateY(-50%);
  width: 16px;
  height: 40px;
  border-radius: var(--cscec-radius-lg);
  background: var(--cscec-bg-content-color);
  border: 1px solid var(--cscec-line-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
}

.cscec-tree-collapse-handle:hover {
  border-color: var(--cscec-primary-color);
}

.cscec-split-tree-pane.is-collapsed .cscec-tree-collapse-handle img,
.cscec-split-tree-pane.is-collapsed .cscec-tree-collapse-handle svg {
  transform: rotate(180deg);
}

.cscec-split-content-pane {
  flex: 1;
  min-width: 0;
  padding: var(--cscec-space-4x) 0 var(--cscec-space-5x);
  display: flex;
  flex-direction: column;
  gap: var(--cscec-space-4x);
  position: relative;
}

/* --------------------------------------------------------------------------
   4. 完整 24 栅格系统（卡片间 8N 间距，单行建议最多 4 个盒子）
   -------------------------------------------------------------------------- */
.cscec-row {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: var(--cscec-space-4x);
}

.cscec-row > * {
  min-width: 0;
}

.cscec-row-gap-20 {
  gap: var(--cscec-space-5x);
}

.cscec-col-24 { grid-column: span 24 / span 24; }
.cscec-col-22 { grid-column: span 22 / span 22; }
.cscec-col-20 { grid-column: span 20 / span 20; }
.cscec-col-18 { grid-column: span 18 / span 18; }
.cscec-col-16 { grid-column: span 16 / span 16; }
.cscec-col-15 { grid-column: span 15 / span 15; }
.cscec-col-14 { grid-column: span 14 / span 14; }
.cscec-col-12 { grid-column: span 12 / span 12; }
.cscec-col-10 { grid-column: span 10 / span 10; }
.cscec-col-9  { grid-column: span 9 / span 9; }
.cscec-col-8  { grid-column: span 8 / span 8; }
.cscec-col-6  { grid-column: span 6 / span 6; }
.cscec-col-4  { grid-column: span 4 / span 4; }
.cscec-col-3  { grid-column: span 3 / span 3; }
.cscec-col-2  { grid-column: span 2 / span 2; }
.cscec-col-1  { grid-column: span 1 / span 1; }

/* --------------------------------------------------------------------------
   5. 官网展示系统框架（居中 960~1440px，72px 顶栏，Banner 480-720 / 240-480，240px Footer）
   -------------------------------------------------------------------------- */
.cscec-portal-shell {
  min-width: 1200px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cscec-bg-content-color);
}

.cscec-portal-header {
  height: var(--cscec-portal-header-height);
  background: var(--cscec-bg-content-color);
  border-bottom: 1px solid var(--cscec-line-color);
  position: sticky;
  top: 0;
  z-index: var(--cscec-z-header);
}

.cscec-portal-container {
  width: 100%;
  max-width: 1440px;
  min-width: 960px;
  margin: 0 auto;
  padding: 0 var(--cscec-space-6x);
}

.cscec-portal-container-narrow {
  max-width: 1280px;
}

.cscec-portal-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cscec-portal-nav {
  display: flex;
  align-items: center;
  gap: var(--cscec-space-8x);
}

.cscec-portal-nav a {
  font-size: var(--cscec-font-s3);
  color: var(--cscec-font-base-color);
  font-weight: 400;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.cscec-portal-nav a.is-active,
.cscec-portal-nav a:hover {
  color: var(--cscec-primary-color);
  border-bottom-color: var(--cscec-primary-color);
}

.cscec-portal-banner-home {
  width: 100%;
  min-height: 480px;
  max-height: 720px;
  height: 520px;
  background: linear-gradient(120deg, #003079 0%, #0080ff 58%, #2eb9ff 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
}

.cscec-portal-banner-sub {
  width: 100%;
  min-height: 240px;
  max-height: 480px;
  height: 300px;
  background: linear-gradient(120deg, #003079 0%, #0080ff 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
}

.cscec-portal-section {
  padding: 48px 0;
}

.cscec-portal-footer {
  margin-top: auto;
  min-height: 240px;
  background: #192029;
  color: rgba(255, 255, 255, 0.78);
  padding: 40px 0 24px;
}

/* --------------------------------------------------------------------------
   6. 登录页规范（全屏底图 + 左上角 Logo + 右侧 480px 70% 半透明毛玻璃卡片）
   -------------------------------------------------------------------------- */
.cscec-login-page {
  min-width: 1280px;
  min-height: 100vh;
  position: relative;
  display: flex;
  justify-content: flex-end;
  background: linear-gradient(135deg, #001c4d 0%, #0048a6 45%, #0080ff 100%);
  background-size: cover;
  background-position: center;
}

.cscec-login-logo {
  position: absolute;
  top: 32px;
  left: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-size: var(--cscec-font-s5);
  font-weight: 700;
}

.cscec-login-card {
  width: 480px;
  min-height: 100vh;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 64px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------------------------
   7. 右侧悬浮锚点与返回顶部（锚点默认 50% 透明，悬停 100%；返回顶部 64x64）
   -------------------------------------------------------------------------- */
.cscec-anchor-float {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--cscec-z-anchor);
  background: var(--cscec-bg-content-color);
  border: 1px solid var(--cscec-line-color);
  border-radius: var(--cscec-radius-lg);
  padding: 8px;
  width: 112px;
  opacity: 0.5;
  transition: opacity 0.2s, width 0.2s;
  box-shadow: var(--cscec-shadow-card);
}

.cscec-anchor-float:hover {
  opacity: 1;
}

.cscec-anchor-float.is-collapsed {
  width: 36px;
  padding: 8px 6px;
}

.cscec-anchor-float.is-collapsed .cscec-anchor-links {
  display: none;
}

.cscec-anchor-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px 6px 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--cscec-line-color);
  color: var(--cscec-font-secondary-color);
  font-size: var(--cscec-font-s1);
  cursor: pointer;
}

.cscec-anchor-float.is-collapsed .cscec-anchor-toggle {
  justify-content: center;
  border-bottom: none;
  margin-bottom: 0;
  padding: 2px;
}

.cscec-anchor-link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--cscec-radius-sm);
  font-size: var(--cscec-font-s1);
  color: var(--cscec-font-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cscec-anchor-link:hover {
  color: var(--cscec-primary-color);
}

.cscec-anchor-link.is-active {
  background: var(--cscec-primary-color-10);
  color: var(--cscec-primary-color);
  font-weight: 600;
}

.cscec-back-top {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cscec-bg-content-color);
  border: 1px solid var(--cscec-line-color);
  box-shadow: var(--cscec-shadow-elevated);
  color: var(--cscec-font-secondary-color);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: var(--cscec-z-anchor);
}

.cscec-back-top.is-visible {
  display: flex;
}

.cscec-back-top:hover {
  color: var(--cscec-primary-color);
  border-color: var(--cscec-primary-color);
}

/* --------------------------------------------------------------------------
   8. 上下布局无二级菜单时隐藏左侧菜单（14808:346423 P18）
   -------------------------------------------------------------------------- */
.cscec-app-shell.is-top-only .cscec-sider {
  display: none;
}

.cscec-app-shell.is-top-only .cscec-main-scroll {
  flex: 1;
  width: 100%;
}
