/* =====================================================================
   shell.css — 整体框架：侧边栏 / 顶栏 / 内容区 / 底部用户卡
   ===================================================================== */

#app {
  display: flex;
  min-height: 100vh;
}

/* ===================== 侧边栏 ===================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: #fff;
  border-right: 1px solid #e8eaec;
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease;
  z-index: 20;
}

.sidebar.is-collapsed {
  width: 64px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 16px;
  flex: none;
  border-bottom: 1px solid #f2f4f7;
  overflow: hidden;
}

.sidebar__logo {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 6px;
}

.sidebar__title {
  font-size: 15px;
  font-weight: 600;
  color: #303133;
  white-space: nowrap;
}

.sidebar__menu {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  margin-bottom: 2px;
  border-radius: 6px;
  color: #4b5563;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.menu-item:hover {
  background: #f5f7fa;
  color: var(--el-color-primary);
}

.menu-item.is-active {
  color: var(--el-color-primary);
  font-weight: 500;
}

.menu-item__icon {
  display: inline-flex;
  flex: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

.menu-item__icon svg {
  width: 18px;
  height: 18px;
}

.menu-item__text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item__arrow {
  display: inline-flex;
  transition: transform 0.2s;
  color: #909399;
}

.menu-group.is-open .menu-item__arrow {
  transform: rotate(180deg);
}

.menu-sub {
  padding: 2px 0 4px 0;
}

.menu-sub__item {
  display: block;
  height: 40px;
  line-height: 40px;
  padding: 0 12px 0 40px;
  margin: 0 0 2px;
  border-radius: 6px;
  color: #4b5563;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.menu-sub__item:hover {
  background: #f5f7fa;
  color: var(--el-color-primary);
}

.menu-sub__item.is-active {
  color: var(--el-color-primary);
  background: #f0f7ff;
  font-weight: 500;
}

/* ===================== 底部用户卡 ===================== */
.sidebar__footer {
  flex: none;
  padding: 0 10px 12px;
}

.user-card {
  border-top: 1px solid #eef0f3;
  padding-top: 10px;
  font-size: 12.5px;
  color: #606266;
}

.user-card__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}

.user-card__tools-left {
  display: flex;
  align-items: center;
  gap: 2px;
}

.user-card__tools .icon-btn {
  width: 24px;
  height: 24px;
  color: #6b7280;
}

.online-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #d9ecff;
  background: #f0f9ff;
  border-radius: 11px;
  color: #409eff;
  font-size: 12px;
  white-space: nowrap;
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #67c23a;
  box-shadow: 0 0 0 2px rgba(103, 194, 58, 0.18);
}

.user-card__info {
  line-height: 1.9;
}

.user-card__info b {
  color: #303133;
  font-weight: 600;
}

.user-card__ip b {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.user-card__license {
  margin-top: 8px;
  display: block;
  padding: 4px 8px;
  border: 1px solid #b3e19d;
  border-radius: 4px;
  color: #529b2e;
  background: #f0f9eb;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* ===================== 主区域 ===================== */
.main {
  flex: 1;
  min-width: 0;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s ease;
}

.sidebar.is-collapsed ~ .main {
  margin-left: 64px;
}

.topbar {
  height: 58px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px 0 10px;
  background: #fff;
  border-bottom: 1px solid #eef0f3;
  position: sticky;
  top: 0;
  z-index: 10;
}

.collapse-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #606266;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.collapse-btn:hover {
  background: #f5f7fa;
  color: var(--el-color-primary);
}

.collapse-btn svg {
  width: 18px;
  height: 18px;
}

.topbar__title {
  font-size: 19px;
  font-weight: 600;
  color: #303133;
  letter-spacing: 0.2px;
}

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 顶栏用户下拉 */
.user-dropdown {
  position: relative;
}

.user-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 17px;
  background: transparent;
  color: #303133;
}

.user-dropdown__trigger:hover {
  background: #f5f7fa;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #79bbff, #409eff);
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.user-dropdown__role {
  font-size: 12px;
  color: #909399;
}

.user-dropdown__menu {
  position: absolute;
  right: 0;
  top: 40px;
  min-width: 132px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: var(--el-radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 30;
}

.user-dropdown__item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13.5px;
  color: var(--el-text-regular);
}

.user-dropdown__item:hover {
  background: #f5f7fa;
  color: var(--el-color-primary);
}

.user-dropdown__item--danger:hover {
  color: var(--el-color-danger);
}

/* ===================== 内容区 ===================== */
.content {
  flex: 1;
  padding: 20px 22px 32px;
  min-width: 0;
}

.page {
  animation: page-in 0.2s ease;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page__header {
  margin-bottom: 16px;
}

.page__desc {
  color: var(--el-text-secondary);
  font-size: 13px;
  margin-top: 6px;
}

/* 响应式 */
@media (max-width: 960px) {
  .sidebar {
    width: 64px;
  }
  .sidebar .sidebar__title,
  .sidebar .menu-item__text,
  .sidebar .menu-item__arrow,
  .sidebar .sidebar__footer {
    display: none !important;
  }
  .main,
  .sidebar.is-collapsed ~ .main {
    margin-left: 64px;
  }
  .desc-list--3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
