.auth-entry {
  gap: 6px;
}

.auth-entry.is-member {
  color: var(--cinnabar);
}

.auth-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 34px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 253, 246, 0.95), transparent 60%),
    var(--paper-light);
  color: var(--ink);
  box-shadow: 0 40px 90px -40px rgba(42, 30, 16, 0.55);
}

.auth-dialog::backdrop {
  background: rgba(24, 22, 18, 0.5);
  backdrop-filter: blur(3px);
}

.auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.auth-close:hover { color: var(--cinnabar); }

.auth-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cinnabar);
}

.auth-dialog h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.02em;
}

.auth-note {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-muted);
}

.auth-form { display: grid; gap: 14px; }

.auth-form label { display: grid; gap: 6px; font-size: 12px; color: var(--ink-soft); }

.auth-form input {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.auth-form input:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(174, 138, 81, 0.18);
}

.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; min-width: 0; }

.auth-inline-button {
  flex: none;
  padding: 0 14px;
  font: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.auth-inline-button:hover:not(:disabled) { border-color: var(--gold); color: var(--ink); }
.auth-inline-button:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-submit { width: 100%; margin-top: 4px; text-align: center; }

.auth-hint {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--ink-muted);
}

.auth-hint.is-error { color: var(--cinnabar); }
.auth-hint.is-ok { color: var(--moss); }

.auth-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0 0 18px;
  background: var(--line);
  border: 1px solid var(--line);
}

.auth-stats > div { background: rgba(255, 253, 246, 0.9); padding: 14px 16px; }
.auth-stats dt { font-size: 12px; color: var(--ink-muted); }
.auth-stats dd {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.2;
}

.auth-actions { display: grid; gap: 10px; }

.auth-text-link {
  justify-self: start;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
}

.auth-text-link:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.auth-logout { margin-top: 18px; color: var(--ink-muted); }

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  padding: 11px 20px;
  font-size: 13px;
  color: var(--paper-light);
  background: var(--ink);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: calc(100% - 32px);
}

.auth-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .auth-dialog { padding: 28px 22px 24px; }
  .auth-code-row { flex-direction: column; }
  .auth-inline-button { padding: 10px; }
}

/* 原站样式在窄屏会隐藏所有 .text-action，这里单独保留登录入口。 */
@media (max-width: 1180px) {
  .header-actions > .auth-entry {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 520px) {
  .header-actions > .auth-entry span[data-auth-label] {
    max-width: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
