/* 门户页样式增强：避免覆盖、适配新版卡片结构 */

/* 防止顶栏与 portal-shell 重叠 */
.portal-shell {
  padding-top: 0;
  margin-top: 56px;
  /* 抵消固定导航栏高度，防止正文被压住 */
}

/* 侧边栏固定宽度，与主内容严格分离 */
.portal-side {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  box-sizing: border-box;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

/* 主内容区明确左边界，避免被侧边栏覆盖 */
.portal-main {
  margin-left: 0;
  min-width: 0;
  overflow: visible;
  padding: 40px 32px 80px;
}

/* 侧边栏导航 */
.portal-sidenav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 24px;
}
.portal-side-link {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.portal-side-link:hover,
.portal-side-link.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.portal-side-logout {
  margin-top: auto;
  color: #f8b4b4;
}
.portal-side-logout:hover {
  background: rgba(248, 180, 180, .14);
  color: #fff;
}

/* 品牌标识 */
.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}
.portal-brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--tw-green-700));
  display: inline-block;
}

/* 用户信息 */
.portal-userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}
.portal-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--tw-green-700));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.portal-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.portal-user-meta strong {
  color: #fff;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-user-tag {
  color: rgba(255, 255, 255, .65);
  font-size: 12px;
}

/* 新版 app-card 结构适配 */
.app-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  position: relative;
  padding-top: 28px;
}
.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--tw-green-700));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 16px;
}
.app-status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.app-status-live {
  color: #0e6b3a;
  background: rgba(46, 204, 113, .14);
}
.app-status-soon {
  color: #a05a18;
  background: rgba(242, 153, 74, .14);
}
.app-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--tw-green-900);
  margin-bottom: 6px;
}
.app-desc {
  font-size: 13px;
  color: var(--tw-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}
.app-go,
.app-soon {
  font-size: 14px;
  font-weight: 700;
}
.app-go {
  color: var(--tw-green-700);
}
.app-card.soon {
  opacity: .85;
  border-style: dashed;
  background: repeating-linear-gradient(
    135deg,
    var(--tw-surface),
    var(--tw-surface) 10px,
    rgba(242, 153, 74, .04) 10px,
    rgba(242, 153, 74, .04) 20px
  );
}
.app-card.soon .app-soon {
  color: #c2620f;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 6px;
}
.badge-live {
  color: #0e6b3a;
  background: rgba(46, 204, 113, .14);
}
.badge-soon {
  color: #a05a18;
  background: rgba(242, 153, 74, .14);
}

/* 分组标题 */
.portal-group {
  margin-bottom: 42px;
}
.portal-group-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--tw-green-900);
  margin-bottom: 18px;
}

/* Hero */
.portal-hero {
  margin-bottom: 36px;
}
.portal-hero h1 {
  font-size: 32px;
  color: var(--tw-green-900);
  margin: 8px 0 6px;
}
.portal-hero .eyebrow {
  color: var(--tw-green-600);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.portal-hero .muted {
  color: var(--tw-muted);
  font-size: 14px;
}

/* 响应式：移动端隐藏侧边栏 */
@media (max-width: 768px) {
  .portal-shell {
    display: block;
  }
  .portal-side {
    display: none;
  }
  .portal-main {
    padding: 24px 18px 60px;
  }
  .portal-hero h1 {
    font-size: 24px;
  }
  .app-grid {
    grid-template-columns: 1fr;
  }
}
