:root {
  --site-shell-bg: rgba(8, 17, 32, .88);
  --site-shell-line: rgba(171, 199, 239, .22);
  --site-shell-text: #edf5ff;
  --site-shell-muted: #aebed4;
  --site-shell-accent: #ff9455;
}

@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: site-view-out 150ms cubic-bezier(.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: site-view-in 240ms cubic-bezier(.2, .8, .2, 1) both;
}

body {
  animation: site-page-enter 240ms cubic-bezier(.2, .8, .2, 1) both;
}

html.site-is-leaving body {
  opacity: 0;
  transform: translateY(-4px) scale(.998);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
}

.site-shell-auth {
  position: fixed;
  z-index: 2147483000;
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 4px;
  border: 1px solid var(--site-shell-line);
  border-radius: 999px;
  color: var(--site-shell-text);
  background: var(--site-shell-bg);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  font-family: Inter, "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  animation: site-auth-arrive 260ms 80ms cubic-bezier(.2, .8, .2, 1) both;
  isolation: isolate;
}

.site-shell-auth a,
.site-shell-auth button,
.site-shell-auth__identity {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--site-shell-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.site-shell-auth a:hover,
.site-shell-auth button:hover {
  color: var(--site-shell-text);
  background: rgba(255, 255, 255, .08);
}

.site-shell-auth a:active,
.site-shell-auth button:active { transform: scale(.97); }

.site-shell-auth a:focus-visible,
.site-shell-auth button:focus-visible {
  outline: 2px solid #8fb8ff;
  outline-offset: 2px;
}

.site-shell-auth__primary,
.site-shell-auth [aria-current="page"] {
  color: #111827 !important;
  background: linear-gradient(135deg, #ffb074, var(--site-shell-accent)) !important;
  box-shadow: 0 7px 18px rgba(255, 126, 52, .22);
}

.site-shell-auth__home {
  color: var(--site-shell-text) !important;
  background: rgba(255, 255, 255, .075) !important;
  box-shadow: inset -1px 0 0 rgba(171, 199, 239, .16);
}

.site-shell-auth__home:hover {
  background: rgba(255, 255, 255, .13) !important;
}

.site-shell-auth__home-mark {
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
}

.site-shell-auth__identity {
  max-width: 156px;
  color: var(--site-shell-text);
  cursor: default;
}

.site-shell-auth__identity span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-shell-auth__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #63dfbd;
  box-shadow: 0 0 0 4px rgba(99, 223, 189, .11);
}

.site-shell-account-replaced { display: none !important; }

body.site-shell-mounted :where(.nav, .topbar, .studio-workbar, .top) {
  padding-right: 280px;
}

.auth-card.site-auth-switching {
  animation: site-auth-card-switch 220ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes site-page-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes site-view-out {
  to { opacity: 0; transform: translateY(-4px) scale(.998); }
}

@keyframes site-view-in {
  from { opacity: 0; transform: translateY(5px); }
}

@keyframes site-auth-arrive {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: none; }
}

@keyframes site-auth-card-switch {
  0% { opacity: .68; transform: translateY(3px); }
  100% { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .site-shell-auth {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    min-height: 46px;
  }

  .site-shell-auth a,
  .site-shell-auth button,
  .site-shell-auth__identity {
    min-height: 44px;
    padding-inline: 11px;
    font-size: 11px;
  }

  .site-shell-auth__home { padding-inline: 10px !important; }
  .site-shell-auth__home-label { font-size: 0; }
  .site-shell-auth__home-label::after { content: "首页"; font-size: 11px; }
  .site-shell-auth__home-mark { font-size: 17px; }

  body.site-shell-mounted :where(.nav, .topbar, .studio-workbar, .top) {
    min-height: 64px;
    padding-right: 190px;
  }
}

@media (max-width: 420px) {
  .site-shell-auth a,
  .site-shell-auth button { padding-inline: 10px; }
  .site-shell-auth__identity { max-width: 112px; }
  body.site-shell-mounted :where(.nav, .topbar, .studio-workbar, .top) { padding-right: 174px; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
