body {
  font-size: 0.875rem;
  background-color: #f8f9fa;
}

.feather {
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
}

/*
 * 侧边栏
 */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100; /* 位于内容之后 */
  padding: 48px 0 0; /* 顶部高度 */
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
}

@media (max-width: 767.98px) {
  .sidebar {
    top: 5rem;
  }
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: calc(100vh - 48px);
  padding-top: 0.5rem;
  overflow-x: hidden;
  overflow-y: auto; /* 如果视口高度小于内容，则可滚动 */
}

.sidebar .nav-link {
  font-weight: 500;
  color: #adb5bd;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 0.25rem;
}

.sidebar .nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.2);
}

.sidebar .nav-link .feather {
  margin-right: 4px;
  color: #999;
}

.sidebar .nav-link.active .feather {
  color: inherit;
}

.sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
}

/*
 * 导航栏
 */
.navbar-brand {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  font-size: 1rem;
  background-color: rgba(0, 0, 0, 0.25);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25);
}

.navbar .navbar-toggler {
  top: 0.25rem;
  right: 1rem;
}

.navbar .form-control {
  padding: 0.75rem 1rem;
  border-width: 0;
  border-radius: 0;
}

.form-control-dark {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

.form-control-dark:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* 卡片样式 */
.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1.5rem;
  border: none;
  border-radius: 0.5rem;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

/* 表格样式 */
.table {
  font-size: 0.875rem;
}

.table th {
  font-weight: 600;
  background-color: #f8f9fa;
}

/* 按钮样式 */
.btn-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* 模态框样式 */
.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 加载中动画 */
.loading {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 0.2rem solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #007bff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 状态标签 */
.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-available {
  background-color: #d1e7dd;
  color: #0f5132;
}

.status-used {
  background-color: #f8d7da;
  color: #842029;
}

.status-pending {
  background-color: #fff3cd;
  color: #664d03;
}

/* 工具提示 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 响应式调整 */
@media (max-width: 767.98px) {
  .card-deck {
    display: block;
  }
}

/* 密钥表格中的密钥列宽度限制 */
#keysTable td:nth-child(2) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 订单表格中的订单号列宽度限制 */
#ordersTable td:nth-child(2) {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 爱发电配置表格中的Token列宽度限制 */
#afdianTable td:nth-child(3) {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 表格操作按钮 */
.action-btn {
  padding: 0.125rem 0.25rem;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

/* 表格内容居中 */
.table th {
  text-align: center;
}

.table td {
  text-align: center;
  vertical-align: middle;
}

/* 仪表盘卡片 */
.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0;
}

/* 图表容器 */
#keyPoolChart {
  height: 250px !important;
}
