.auth-header-slot {
  position: relative;
  z-index: 120;
  display: flex;
  flex: none;
  align-items: center;
  color: #fff;
}

body[data-auth-guard]:not([data-auth-guard-state]) {
  min-height: 100vh;
  overflow: hidden;
}

body[data-auth-guard]:not([data-auth-guard-state]) > * {
  visibility: hidden;
}

body[data-auth-guard]:not([data-auth-guard-state])::before {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  visibility: visible;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(22, 207, 194, 0.12), transparent 24%),
    #f3f7f8;
  color: #315264;
  content: "正在验证访问权限…";
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.auth-signin-link,
.auth-account-trigger {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(142, 240, 200, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding: 6px 13px 6px 7px;
  font-family: inherit;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.auth-signin-link:hover,
.auth-signin-link:focus-visible,
.auth-account-trigger:hover,
.auth-account-trigger:focus-visible {
  border-color: #8ef0c8;
  background: rgba(142, 240, 200, 0.12);
  color: #8ef0c8;
  outline: none;
  text-decoration: none;
}

.auth-signin-link > span,
.auth-account-trigger > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #16cfc2, #0d8e91);
  color: #04131f;
  font-size: 11px;
  font-weight: 900;
}

.auth-signin-link b,
.auth-account-trigger b {
  max-width: 92px;
  overflow: hidden;
  font: inherit;
  font-weight: 800;
  text-overflow: ellipsis;
}

.auth-account-trigger i {
  color: #a9c1cc;
  font-size: 11px;
  font-style: normal;
}

.auth-account-menu {
  position: absolute;
  z-index: 500;
  top: calc(100% + 10px);
  right: 0;
  width: min(290px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid #d5e1e7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(2, 18, 30, 0.2);
  color: #102638;
}

.auth-account-menu[hidden] {
  display: none !important;
}

.auth-account-identity {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid #e2e9ed;
  background: #f5f9fa;
  padding: 15px 16px 13px;
}

.auth-account-identity strong {
  font-size: 14px;
}

.auth-account-identity span {
  overflow: hidden;
  color: #607180;
  font-size: 12px;
  text-overflow: ellipsis;
}

.auth-account-identity small {
  margin-top: 5px;
  color: #0d8e91;
  font-size: 11px;
  font-weight: 800;
}

.auth-account-menu > a,
.auth-account-menu > button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #edf1f3;
  background: #fff;
  color: #294456;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.auth-account-menu > a:hover,
.auth-account-menu > a:focus-visible,
.auth-account-menu > button:hover,
.auth-account-menu > button:focus-visible {
  background: #eefaf8;
  color: #087f77;
  outline: none;
  text-decoration: none;
}

.auth-account-menu > button {
  border-bottom: 0;
  color: #8a3f31;
}

.topbar:has(.portal-nav) {
  grid-template-columns: 240px minmax(0, 1fr) 135px auto;
}

.topbar:has(.portal-nav) > .source-status {
  grid-column: 3;
}

.topbar:has(.portal-nav) > .auth-header-slot {
  grid-column: 4;
  justify-self: end;
}

.topbar:has(.portal-nav) .auth-signin-link,
.topbar:has(.portal-nav) .auth-account-trigger {
  border-color: #bfd4d8;
  background: #f2f8f8;
  color: #294f5e;
}

.topbar:has(.portal-nav) .auth-signin-link:hover,
.topbar:has(.portal-nav) .auth-signin-link:focus-visible,
.topbar:has(.portal-nav) .auth-account-trigger:hover,
.topbar:has(.portal-nav) .auth-account-trigger:focus-visible {
  border-color: #0d8e91;
  background: #e8f7f5;
  color: #087f77;
}

.auth-access-gate {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
  align-content: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(22, 207, 194, 0.12), transparent 28%),
    #f3f7f8;
  padding: 48px 22px;
  text-align: center;
}

.auth-access-gate > span {
  display: grid;
  width: 64px;
  height: 68px;
  place-items: center;
  border: 1px solid #bcd7d7;
  border-radius: 18px 18px 22px 22px;
  background: #e9f9f6;
  color: #087f77;
  font-size: 17px;
  font-weight: 900;
}

.auth-access-gate h1 {
  margin: 20px 0 8px;
  color: #102638;
  font-size: clamp(26px, 4vw, 38px);
}

.auth-access-gate p {
  max-width: 620px;
  margin: 0;
  color: #607180;
  line-height: 1.75;
}

.auth-access-gate div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.auth-access-gate a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #0d8e91;
  border-radius: 9px;
  background: #0d8e91;
  color: #fff;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.auth-access-gate a.secondary {
  background: #fff;
  color: #294456;
}

@media (max-width: 1180px) {
  .auth-account-trigger b {
    display: none;
  }

  .auth-account-trigger {
    padding-right: 7px;
  }

  .auth-account-trigger i {
    display: none;
  }

  .topbar:has(.portal-nav) {
    grid-template-columns: 210px minmax(0, 1fr) 120px auto;
    gap: 12px;
  }
}

@media (max-width: 760px) {
  .topbar:has(.portal-nav) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .topbar:has(.portal-nav) > .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar:has(.portal-nav) > .source-status {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar:has(.portal-nav) > .auth-header-slot {
    position: static;
    grid-column: 3;
    grid-row: 1;
  }

  .topbar:has(.portal-nav) > .portal-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .topbar > .auth-header-slot {
    position: absolute;
    top: 10px;
    right: 14px;
  }

  .sitebar-inner > .auth-header-slot {
    margin-left: auto;
  }

  .header-actions > .auth-header-slot,
  .sitebar-actions > .auth-header-slot {
    position: absolute;
    top: 9px;
    right: 14px;
    margin-left: 0;
  }

  .auth-signin-link,
  .auth-account-trigger {
    min-height: 34px;
    padding: 4px 9px 4px 5px;
  }

  .auth-signin-link > span,
  .auth-account-trigger > span {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .auth-signin-link b {
    display: none;
  }

  .auth-signin-link {
    padding-right: 5px;
  }
}
