/* ========================================
   Service Center - 统一样式文件
   仅补充Bootstrap 4未覆盖的必要样式
   ======================================== */

/* --- 顶部导航栏 --- */
.navbar-top {
  min-height: 48px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

/* --- 移动端遮罩层 --- */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1025;
}
.mobile-overlay.show { display: block; }

/* --- 拖拽指示条（通用） --- */
.drag-handle {
  display: block;
  width: 40px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
  margin: 0 auto;
}

/* --- 侧边栏布局 --- */
.sidebar {
  position: fixed;
  top: 48px;
  left: 0;
  width: 220px;
  height: calc(100vh - 48px);
  overflow-y: auto;
  z-index: 1020;
  transition: transform 0.25s ease;
}

/* --- 菜单通用样式 --- */
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu a {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar-menu a:hover {
  background: #f8f9fa;
  color: #007bff;
  border-left-color: #007bff;
}

/* 子菜单 */
.sidebar-menu .submenu {
  list-style: none;
  padding: 0;
  background: #f8f9fa;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.sidebar-menu .open > .submenu { max-height: 500px; }
.sidebar-menu .submenu a { padding-left: 32px; font-size: 13px; }

/* 展开箭头 */
.sidebar-menu .has-sub > a::after {
  content: '\f107';
  font-family: FontAwesome;
  float: right;
  transition: transform 0.3s ease;
}
.sidebar-menu .has-sub.open > a::after { transform: rotate(180deg); }

/* 浮动菜单按钮 */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  z-index: 1040;
}

/* --- 主内容区 --- */
.main-content {
  margin-left: 220px;
  margin-top: 48px;
  padding: 16px;
  min-height: calc(100vh - 48px);
}

.breadcrumb-bar {
  margin-left: 220px;
  margin-top: 48px;
}

/* --- 首页卡片网格 --- */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* --- Flash消息 --- */
.w2p_flash {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

/* ========================================
   移动端适配（≤767.98px）
   ======================================== */
@media (max-width: 767.98px) {

  /* --- 顶部导航下拉面板 --- */
  .navbar-top .navbar-collapse {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 12px 0 24px;
  }
  .navbar-top .navbar-collapse::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 12px auto 0;
  }

  /* 顶部导航菜单样式（与侧边栏统一） */
  .navbar-top .navbar-nav { padding: 0; margin: 0; }
  .navbar-top .nav-item { border: none; }
  .navbar-top .nav-link {
    display: block;
    padding: 10px 16px !important;
    color: #333 !important;
    font-size: 14px;
    border-left: 3px solid transparent;
  }
  .navbar-top .nav-link:hover {
    background: #f8f9fa;
    color: #007bff !important;
    border-left-color: #007bff;
  }

  /* 顶部导航子菜单 */
  .navbar-top .dropdown-menu {
    position: static !important;
    float: none;
    border: none;
    box-shadow: none;
    background: #f8f9fa;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: block;
  }
  .navbar-top .dropdown.show .dropdown-menu { max-height: 500px; }
  .navbar-top .dropdown-item {
    padding: 10px 16px 10px 32px;
    color: #333;
    font-size: 13px;
    border-left: 3px solid transparent;
  }
  .navbar-top .dropdown-item:hover {
    background: #e9ecef;
    color: #007bff;
    border-left-color: #007bff;
  }

  /* 顶部导航箭头 */
  .navbar-top .dropdown-toggle::after {
    float: right;
    margin-top: 8px;
    transition: transform 0.3s ease;
  }
  .navbar-top .dropdown.show .dropdown-toggle::after { transform: rotate(180deg); }

  /* --- 侧边栏底部滑出 --- */
  .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1030;
    padding: 12px 0 24px;
  }
  .sidebar::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 0 auto 8px;
  }
  .sidebar.show { transform: translateY(0); }
  .sidebar-toggle { display: block; }

  /* 布局重置 */
  .main-content, .breadcrumb-bar { margin-left: 0 !important; }
}
