html {
  font-size: 14px;
}

/* 操作按钮样式优化 */
.btn-group-sm .btn,
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease-in-out;
}

.btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary:hover {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.btn-outline-success:hover {
  background-color: #198754;
  border-color: #198754;
  color: #fff;
}

.btn-outline-info:hover {
  background-color: #0dcaf0;
  border-color: #0dcaf0;
  color: #fff;
}

/* 表格操作列样式 */
.table td:last-child {
  white-space: nowrap;
  vertical-align: middle;
}

/* 按钮组间距 */
.d-flex.gap-1>* {
  margin-right: 0.25rem;
}

.d-flex.gap-1>*:last-child {
  margin-right: 0;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* 导航栏样式 - 黑白灰 */
.navbar {
  background-color: #2c3e50 !important;
  border-bottom: 1px solid #34495e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 600;
  color: #fff !important;
  font-size: 1.2rem;
}

.navbar-nav .nav-link {
  color: #ecf0f1 !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: background-color 0.3s;
}

.navbar-nav .nav-link:hover {
  background-color: #34495e;
  color: #fff !important;
}

.navbar-nav .nav-link.active {
  background-color: #34495e;
  color: #fff !important;
}

/* 下拉菜单样式 */
.dropdown-menu {
  background-color: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  color: #333;
  padding: 0.5rem 1rem;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
  color: #2c3e50;
}

/* 卡片样式 */
.card {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem;
  font-weight: 600;
  color: #2c3e50;
}

.card-body {
  padding: 1.5rem;
}

/* 按钮样式 - 黑白灰 */
.btn-primary {
  background-color: #2c3e50;
  border-color: #2c3e50;
  color: #fff;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  transition: all 0.3s;
}

.btn-primary:hover {
  background-color: #34495e;
  border-color: #34495e;
  color: #fff;
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #5a6268;
  color: #fff;
}

.btn-outline-primary {
  border-color: #2c3e50;
  color: #2c3e50;
}

.btn-outline-primary:hover {
  background-color: #2c3e50;
  border-color: #2c3e50;
  color: #fff;
}

/* 表单样式 */
.form-control {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.form-control:focus {
  border-color: #2c3e50;
  box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
}

.form-label {
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

/* 表格样式 */
.table {
  background-color: #fff;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
  color: #2c3e50;
  font-weight: 600;
  padding: 0.75rem;
}

.table tbody tr {
  border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table td {
  padding: 0.75rem;
  color: #333;
}

/* 登录页面样式 */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 420px;
  width: 100%;
}

.login-card-header {
  background-color: #2c3e50;
  color: #fff;
  padding: 1.5rem;
  text-align: center;
  border-radius: 8px 8px 0 0;
}

.login-card-header h4 {
  margin: 0;
  font-weight: 600;
}

.login-card-body {
  padding: 2rem;
}

/* 首页卡片样式 */
.dashboard-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
  height: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.dashboard-card-icon {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.dashboard-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.dashboard-card-text {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.dashboard-card-btn {
  background-color: #2c3e50;
  color: #fff;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s;
}

.dashboard-card-btn:hover {
  background-color: #34495e;
  color: #fff;
}

/* 页脚样式 */
.footer {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 1rem 0;
  margin-top: 3rem;
  border-top: 1px solid #34495e;
}

.footer a {
  color: #ecf0f1;
  text-decoration: none;
}

.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* 错误提示 */
.text-danger {
  color: #dc3545 !important;
}

.alert {
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* 分页样式 */
.pagination {
  margin-top: 1.5rem;
}

.page-link {
  color: #2c3e50;
  border-color: #ddd;
}

.page-link:hover {
  color: #34495e;
  background-color: #f8f9fa;
  border-color: #ddd;
}

.page-item.active .page-link {
  background-color: #2c3e50;
  border-color: #2c3e50;
}

/* 工具提示 */
.badge {
  padding: 0.35em 0.65em;
  font-weight: 500;
}

.badge-primary {
  background-color: #2c3e50;
  color: #fff;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .dashboard-card {
    margin-bottom: 1rem;
  }

  .navbar-nav {
    margin-top: 1rem;
  }
}

/* 通用工具类 */
.text-muted {
  color: #6c757d !important;
}

.bg-light {
  background-color: #f8f9fa !important;
}

.border {
  border: 1px solid #e0e0e0 !important;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* ==================== 侧边栏布局样式 ==================== */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 侧边栏样式 */
.sidebar {
  width: 220px;
  background-color: #2c3e50;
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid #34495e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  position: relative;
  z-index: 10;
}

.sidebar.collapsed .sidebar-header {
  padding: 1rem 0.5rem;
  justify-content: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.sidebar-brand i {
  font-size: 1.5rem;
}

.brand-text {
  transition: opacity 0.3s;
}

.sidebar.collapsed .brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
  display: none;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #ecf0f1;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  position: relative;
}

.sidebar-toggle:hover {
  background-color: #34495e;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:active {
  transform: scale(0.95);
}

.sidebar-toggle i {
  transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 导航项样式 */
.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #ecf0f1;
  text-decoration: none;
  transition: all 0.3s;
  gap: 0.75rem;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background-color: #34495e;
  color: #fff;
  border-left-color: #3498db;
}

.nav-item.active {
  background-color: #34495e;
  color: #fff;
  border-left-color: #3498db;
  font-weight: 500;
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  transition: opacity 0.3s;
  white-space: nowrap;
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* 导航组样式 */
.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #ecf0f1;
  cursor: pointer;
  transition: all 0.3s;
  gap: 0.75rem;
  border-left: 3px solid transparent;
  user-select: none;
}

.nav-group-header:hover {
  background-color: #34495e;
  color: #fff;
}

.nav-group-header.active {
  background-color: #34495e;
  color: #fff;
  border-left-color: #3498db;
  font-weight: 500;
}

.nav-group-header i:first-child {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-arrow {
  margin-left: auto;
  font-size: 0.875rem;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.nav-group.expanded .nav-arrow {
  transform: rotate(180deg);
}

.nav-group-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: #1a252f;
}

.nav-group.expanded .nav-group-content {
  max-height: 1000px;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  color: #bdc3c7;
  text-decoration: none;
  transition: all 0.3s;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.nav-sub-item:hover {
  background-color: #34495e;
  color: #fff;
  padding-left: 2.75rem;
}

.nav-sub-item.active {
  background-color: #34495e;
  color: #3498db;
  font-weight: 500;
}

.nav-sub-item i {
  font-size: 0.5rem;
  width: 8px;
}

.nav-sub-divider {
  height: 1px;
  background-color: #34495e;
  margin: 0.5rem 1rem;
}

.sidebar.collapsed .nav-group-content {
  display: none;
}

.sidebar.collapsed .nav-group-header {
  justify-content: center;
  padding: 0.75rem 0.5rem;
  position: relative;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.75rem 0.5rem;
  position: relative;
}

/* 折叠状态下的悬停菜单 - 通过JavaScript控制显示，这里只定义样式 */

.nav-hover-menu {
  display: none;
  position: fixed;
  background-color: #2c3e50;
  min-width: 200px;
  border-radius: 6px;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  padding: 0.5rem 0;
  border: 1px solid #34495e;
  animation: slideInRight 0.2s ease;
  pointer-events: auto;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-hover-menu::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #2c3e50;
}

.nav-hover-menu-title {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid #34495e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-hover-menu-title i {
  font-size: 1rem;
}

.nav-hover-menu-items {
  padding: 0.25rem 0;
}

.nav-hover-menu-item {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  color: #bdc3c7;
  text-decoration: none;
  transition: all 0.2s;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.nav-hover-menu-item:hover {
  background-color: #34495e;
  color: #fff;
  padding-left: 1.25rem;
}

.nav-hover-menu-item.active {
  background-color: #34495e;
  color: #3498db;
  font-weight: 500;
}

.nav-hover-menu-item i {
  font-size: 0.75rem;
  width: 16px;
  text-align: center;
}

/* 侧边栏底部 */
.sidebar-footer {
  border-top: 1px solid #34495e;
  padding: 1rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.user-info i {
  font-size: 2rem;
  color: #ecf0f1;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
  transition: opacity 0.3s;
}

.sidebar.collapsed .user-details {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.user-name {
  font-weight: 500;
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tenant {
  font-size: 0.75rem;
  color: #95a5a6;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tenant i {
  font-size: 0.75rem;
}

.user-actions .btn-link {
  color: #ecf0f1;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
}

.user-actions .btn-link:hover {
  color: #fff;
  background-color: #34495e;
}

.sidebar.collapsed .user-actions {
  display: none;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 220px;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f5f5f5;
}

.sidebar.collapsed~.main-content {
  margin-left: 70px;
}

/* 顶部导航栏（简化版） */
.top-navbar {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-navbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-navbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 内容区域 */
.content-wrapper {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 220px;
    transition: transform 0.3s ease;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .sidebar.collapsed {
    width: 220px;
    transform: translateX(-100%);
  }

  .sidebar.collapsed.show {
    transform: translateX(0);
  }

  /* 移动端显示菜单按钮 */
  .mobile-menu-toggle {
    display: block !important;
  }

  /* 移动端遮罩层 */
  .sidebar.show::before {
    content: '';
    position: fixed;
    top: 0;
    left: 220px;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }

  .content-wrapper {
    padding: 1rem;
  }

  .top-navbar {
    padding: 0.75rem 1rem;
  }

  .top-navbar-title {
    font-size: 1.1rem;
  }
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #2c3e50;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

/* 滚动条样式 */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #1a252f;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #34495e;
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #4a5f7a;
}