/* =========================================================================
   门户 · 项目索引式首页
   顶栏 + 大标题 + 索引列表 + 通栏页脚，纸面配色，细线分层。
   ========================================================================= */

.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* --- 顶栏 --- */

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 4vw, 44px);
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.portal-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.portal-brand-mark {
  align-self: center;
  width: 12px;
  height: 12px;
  background: var(--grad-brand);
  border-radius: 3px;
}

.portal-brand-name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.portal-brand-sub {
  color: var(--muted);
  font-size: 12.5px;
}

.portal-topbar-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
}

.portal-topbar-nav > a:not(.ghost-button) {
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 130ms ease, border-color 130ms ease;
}

.portal-topbar-nav > a:not(.ghost-button):hover {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

/* --- 主体 --- */

.portal-main {
  flex: 1;
  width: min(880px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) 0 clamp(26px, 4vh, 44px);
}

.portal-hero {
  padding-bottom: clamp(22px, 4vh, 36px);
}

.portal-kicker {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portal-hero-logo {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1435 / 243;
  overflow: hidden;
  margin: 0;
}

.portal-hero-logo img {
  position: absolute;
  top: -128.3%;
  left: -12.9%;
  display: block;
  width: 123.65%;
  max-width: none;
  height: auto;
}

.portal-subtitle {
  max-width: 46ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.7vw, 16.5px);
  line-height: 1.6;
}

/* 标题下方一小段品牌渐变短划，全页唯一的重色点缀 */
.portal-hero::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 20px;
  border-radius: 2px;
  background: var(--grad-brand);
}

/* --- 项目索引列表 --- */

.project-index {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.project-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-row {
  display: grid;
  grid-template-columns: auto 148px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(14px, 2.5vw, 26px);
  padding: 16px 22px;
  color: inherit;
  text-decoration: none;
  transition: background 140ms ease;
}

.project-row + .project-row {
  border-top: 1px solid var(--line);
}

.project-row:hover {
  background: var(--surface-2);
}

.project-no {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.75;
  transition: opacity 140ms ease;
}

.project-row:hover .project-no {
  opacity: 1;
}

.project-media {
  display: grid;
  place-items: center;
  justify-items: start;
  height: 64px;
}

.project-media img {
  display: block;
  max-width: 100%;
  max-height: 56px;
  object-fit: contain;
}

.project-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.project-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.project-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}

.project-status.is-live::before {
  background: var(--green);
}

.project-status.is-beta::before {
  background: var(--amber);
}

.project-arrow {
  color: var(--muted-2);
  font-size: 17px;
  font-weight: 600;
  transition: transform 160ms ease, color 160ms ease;
}

.project-row:hover .project-arrow {
  color: var(--text);
  transform: translateX(4px);
}

/* --- 页脚 --- */

.portal-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.portal-footer-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  width: min(880px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 26px;
  color: var(--muted);
  font-size: 12.5px;
}

.portal-footer-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.portal-footer-brand strong {
  color: var(--text-2);
  font-weight: 700;
}

.portal-footer-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.portal-footer-meta .site-footer-link {
  font-family: var(--font-num);
  font-size: 12px;
}

/* --- 响应式 --- */

@media (max-width: 760px) {
  .portal-topbar {
    min-height: 54px;
  }

  /* 小屏顶栏只留品牌 + 账号，项目链接由下方索引承担 */
  .portal-topbar-nav > a:not(.ghost-button):not(#userDashboardLink) {
    display: none;
  }

  .portal-main {
    width: calc(100% - 32px);
  }

  .project-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "no    media  arrow"
      "info  info   info"
      "status status status";
    row-gap: 12px;
    padding: 16px;
  }

  .project-no { grid-area: no; }
  .project-arrow { grid-area: arrow; justify-self: end; }
  .project-media {
    grid-area: media;
    justify-self: start;
    height: 56px;
  }
  .project-media img { max-height: 44px; }
  .project-info { grid-area: info; }
  .project-status { grid-area: status; justify-self: start; }

  .portal-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    width: calc(100% - 32px);
  }
}
