/* 账号中心：登录 / 注册 / 账号设置 */

.auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--side-line);
  border-radius: 12px;
  background: var(--side-fill);
  color: var(--side-ink);
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.auth-user:hover {
  background: var(--side-hover);
  border-color: rgba(var(--amber-rgb), .45);
}

.auth-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--on-accent);
  background: linear-gradient(140deg, var(--amber), var(--amber-deep));
}

.auth-avatar.signed {
  background: linear-gradient(140deg, #7fb79b, #2f7a5c);
  color: #fff;
}

.auth-user-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-user-copy b {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-copy small {
  font-size: 11px;
  color: var(--side-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-auth {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  cursor: pointer;
}

.mobile-auth .auth-avatar {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 20, .48);
  backdrop-filter: blur(3px);
}

.auth-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  max-height: min(86vh, 780px);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: auth-pop .22s cubic-bezier(.22, .9, .35, 1.1);
}

@keyframes auth-pop {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.auth-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.auth-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-close:hover { color: var(--ink); border-color: var(--line-strong); }

.auth-close svg { width: 14px; height: 14px; }

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px 0;
}

.auth-tab {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--paper-tint);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
}

.auth-tab.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--side-ink);
}

.auth-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
}

.auth-field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.auth-field > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .2px;
}

.auth-field > label em {
  font-style: normal;
  font-weight: 400;
  color: var(--faint);
}

.auth-input,
.auth-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--ui);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.auth-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.auth-row {
  display: flex;
  gap: 8px;
}

.auth-row .auth-input { flex: 1; min-width: 0; }

.auth-code-btn {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 10px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper-tint);
  color: var(--forest);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .16s ease;
}

.auth-code-btn:hover:not(:disabled) {
  border-color: var(--amber);
  color: var(--amber-deep);
}

.auth-code-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px 14px;
  border: 0;
  border-radius: 11px;
  background: var(--forest);
  color: #f4f9f5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease;
}

.auth-submit:hover:not(:disabled) { background: var(--forest-deep); }

.auth-submit:disabled { opacity: .6; cursor: progress; }

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
}

.auth-link {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--amber-deep);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.auth-hint.warn { color: var(--amber-deep); }

.auth-error {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(190, 60, 40, .09);
  color: #a2361f;
  font-size: 12px;
  line-height: 1.5;
}

.auth-ok {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(47, 122, 92, .1);
  color: #256149;
  font-size: 12px;
  line-height: 1.5;
}

.auth-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--paper-tint);
  border: 1px solid var(--line);
}

.auth-seg button {
  padding: 5px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.auth-seg button.active {
  background: var(--white);
  color: var(--forest);
  box-shadow: var(--shadow-sm);
}

.auth-seg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-tint);
}

.auth-account-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-account-main b {
  font-size: 13px;
  color: var(--ink);
}

.auth-account-main small {
  font-size: 12px;
  color: var(--muted);
}

.auth-account-main small.empty { color: var(--faint); }

.auth-account-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.auth-mini {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.auth-mini:hover { border-color: var(--amber); color: var(--amber-deep); }

.auth-mini.danger:hover { border-color: #b8452c; color: #a2361f; }

.auth-mini:disabled { opacity: .5; cursor: not-allowed; }

.auth-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--forest), var(--forest-deep));
  color: var(--side-ink);
}

.auth-profile .auth-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 17px;
}

.auth-profile-copy { display: grid; gap: 3px; min-width: 0; }

.auth-profile-copy b { font-size: 15px; }

.auth-profile-copy small { font-size: 11px; color: var(--side-soft); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--faint);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-sessions {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.auth-session {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--paper-tint);
  font-size: 11px;
  color: var(--muted);
}

.auth-session.current { color: #256149; font-weight: 600; }

.auth-session span:last-child { flex: 0 0 auto; opacity: .8; }

.auth-logout {
  width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid #d8b8ac;
  border-radius: 10px;
  background: transparent;
  color: #a2361f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-logout:hover { background: rgba(190, 60, 40, .07); }

@media (max-width: 560px) {
  .auth-modal { padding: 10px; align-items: end; }
  .auth-card { width: 100%; max-height: 92vh; border-radius: 16px 16px 10px 10px; }
  .auth-body { padding: 14px 16px 18px; }
  .auth-head { padding: 16px 16px 10px; }
  .auth-tabs { padding: 10px 16px 0; }
}
