html body nav .auth-trigger {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  max-width: 150px;
  padding: 7px 13px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 3px;
  background: transparent;
  color: #f5f6fa;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
html body nav .auth-trigger:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.auth-trigger svg { width: 17px; height: 17px; flex-shrink: 0; }
.auth-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-trigger:focus-visible, .auth-dialog button:focus-visible, .auth-dialog a:focus-visible {
  outline: 2px solid #7093d1;
  outline-offset: 4px;
}

.auth-dialog {
  position: fixed;
  inset: 0;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 40px;
  border: 1px solid #e1e3e6;
  border-radius: 8px;
  background: #f8f9fa;
  color: #202229;
  box-shadow: 0 24px 90px rgba(0,0,0,.28);
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  overflow-y: auto;
}
.auth-dialog::backdrop { background: rgba(10,12,18,.6); backdrop-filter: blur(8px); }
.auth-dialog[open] {
  transform-origin: 50% 45%;
  animation: auth-enter .44s cubic-bezier(.16,1,.3,1) both;
}
.auth-dialog[open]::backdrop { animation: auth-backdrop-enter .36s ease-out both; }
.auth-dialog[open].is-closing {
  pointer-events: none;
  animation: auth-leave .24s cubic-bezier(.4,0,1,1) both;
}
.auth-dialog[open].is-closing::backdrop { animation: auth-backdrop-leave .24s ease-in both; }
@keyframes auth-enter {
  from { opacity: 0; transform: translateY(18px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-leave {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(.985); }
}
@keyframes auth-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-backdrop-leave { from { opacity: 1; } to { opacity: 0; } }
.auth-dialog *, .auth-dialog *::before, .auth-dialog *::after { box-sizing: border-box; }
.auth-dialog [hidden] { display: none !important; }
.auth-brand { display: block; width: 125px; height: auto; margin-bottom: 32px; filter: brightness(0); }
.auth-dialog .auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #555b66;
  cursor: pointer;
}
.auth-close svg { width: 19px; height: 19px; }
.auth-dialog h2 { margin: 0; font-size: 27px; font-weight: 500; line-height: 1.3; letter-spacing: -.03em; }
.auth-subtitle { margin: 10px 0 26px; color: #717782; font-size: 13px; line-height: 1.8; }
.auth-subtitle[hidden] + .auth-credentials { margin-top: 26px; }
.auth-dialog form { margin: 0; }
.auth-field { display: grid; gap: 8px; margin: 0 0 18px; }
.auth-field > span, .auth-field > label { color: #4c525e; font-size: 12px; }
.auth-dialog input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #d7dce3;
  border-radius: 3px;
  background: #fff;
  color: #202229;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.auth-dialog input:focus { border-color: #7093d1; box-shadow: 0 0 0 3px rgba(112,147,209,.12); }
.auth-password-wrap { position: relative; display: block; }
.auth-password-wrap input { padding-right: 48px; }
.auth-dialog .auth-password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #737986;
  cursor: pointer;
}
.auth-password-toggle svg { width: 18px; height: 18px; }
.auth-dialog .auth-text-button { padding: 0; border: 0; background: transparent; color: #596a89; font: inherit; font-size: 12px; cursor: pointer; }
.auth-dialog .auth-forgot { display: block; margin: -2px 0 24px auto; }
.auth-dialog .auth-primary, .auth-dialog .auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border: 1px solid #25282e;
  border-radius: 3px;
  background: #25282e;
  color: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
.auth-dialog .auth-primary:hover { background: #393e48; }
.auth-dialog .auth-google { border-color: #d7dce3; background: #fff; color: #25282e; }
.auth-dialog .auth-google:hover { background: #eef1f5; }
.auth-google svg { width: 18px; height: 18px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #949aa4; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #e0e4ea; }
.auth-switch { margin: 25px 0 0; text-align: center; color: #858b96; font-size: 12px; }
.auth-switch button { margin-left: 6px; }
.auth-status { margin: 18px 0 0; font-size: 12px; line-height: 1.8; color: #ad3741; overflow-wrap: anywhere; }
.auth-status[data-tone="success"] { color: #32705b; }
.auth-dialog button:disabled { opacity: .55; cursor: wait; }
.auth-avatar { display: grid; place-items: center; width: 58px; height: 58px; margin: 26px 0 18px; border: 1px solid #dce1e8; border-radius: 50%; background: #e9edf3; color: #425574; font-size: 23px; }
.auth-profile-name { margin: 0 0 7px; font-size: 20px; font-weight: 500; overflow-wrap: anywhere; }
.auth-profile-email { margin: 0 0 24px; color: #717782; font-size: 13px; overflow-wrap: anywhere; }
.auth-profile-note { margin: 0 0 20px; color: #858b96; font-size: 12px; }
.auth-avatar { position: relative; overflow: hidden; flex-shrink: 0; }
.auth-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.auth-avatar.has-photo img { opacity: 1; }
.auth-dialog .auth-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border: 1px solid #d7d7d7;
  border-radius: 3px;
  background: transparent;
  color: #34363b;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.auth-dialog .auth-secondary:hover { background: #ededed; border-color: #aaa; }
.auth-coming-soon { margin: 24px 0; padding: 20px; border: 1px solid #e1e1e1; border-radius: 5px; background: #f1f1f1; }
.auth-coming-soon span { color: #8a8a8a; font-size: 11px; letter-spacing: .08em; }
.auth-coming-soon p { margin: 8px 0 0; color: #505156; font-size: 14px; line-height: 1.7; }
.auth-avatar-editor { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.auth-avatar-editor .auth-avatar { width: 68px; height: 68px; margin: 0; }
.auth-avatar-editor p { margin: 0 0 6px; font-size: 14px; }
.auth-avatar-editor span { color: #858585; font-size: 11px; line-height: 1.7; }
.auth-avatar-options { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; margin-bottom: 24px; }
.auth-dialog .auth-avatar-option { width: 100%; aspect-ratio: 1; padding: 3px; border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; transition: border-color .2s, transform .2s; }
.auth-avatar-option img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.auth-dialog .auth-avatar-option[aria-pressed="true"] { border-color: #34363b; }
.auth-dialog .auth-avatar-option:hover { transform: translateY(-2px); }
.auth-field small { color: #858585; font-size: 11px; line-height: 1.7; }
.auth-dialog .auth-avatar-reset { display: block; margin: -6px 0 24px; color: #646464; }
.auth-profile-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; margin-top: 26px; }
.auth-editor { animation: auth-editor-in .3s ease-out both; }
@keyframes auth-editor-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 800px) {
  html body nav .auth-trigger {
    position: absolute;
    top: 50%;
    right: 64px;
    transform: translateY(-50%);
    width: 38px;
    min-height: 38px;
    padding: 0;
    border: 0;
  }
  .auth-trigger svg { width: 20px; height: 20px; }
  .auth-trigger-label { display: none; }
  .auth-dialog { padding: 32px 24px; }
  .auth-brand { margin-bottom: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-dialog[open], .auth-dialog[open]::backdrop,
  .auth-dialog[open].is-closing, .auth-dialog[open].is-closing::backdrop { animation: none; }
  .auth-editor { animation: none; }
  .auth-dialog .auth-avatar-option { transition: none; transform: none; }
}
