/* 登录弹窗与账号态 —— 依赖 style.css 的变量与按钮 */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(44, 51, 51, .42);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease, ease);
}
.auth-modal.is-open { opacity: 1; pointer-events: auto; }

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #E8E8E4);
  border-radius: 20px;
  box-shadow: 0 28px 60px -20px rgba(44, 51, 51, .28);
  padding: 30px 28px 26px;
  transform: translateY(10px) scale(.985);
  transition: transform .28s var(--ease, ease);
}
.auth-modal.is-open .auth-card { transform: none; }

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary, #8A9191);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.auth-close:hover { background: var(--bg-alt, #F2F2EE); color: var(--text, #2C3333); }

.auth-eyebrow {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-secondary, #8A9191);
}
.auth-title {
  margin: 10px 0 6px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text, #2C3333);
}
.auth-sub {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft, #55605F);
}
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #8A9191);
  margin-bottom: 7px;
}
.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text, #2C3333);
  background: var(--bg, #F8F8F6);
  border: 1px solid var(--border, #E8E8E4);
  border-radius: 12px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.auth-input:focus { border-color: var(--primary-deep, #8FA3A1); background: #fff; }
.auth-input--code {
  letter-spacing: .4em;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  padding-left: .4em;
}
.auth-row { display: flex; gap: 10px; }
.auth-row .auth-input { flex: 1; }

.auth-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: var(--text, #2C3333);
  color: #fff;
  transition: opacity .2s, transform .2s;
}
.auth-btn:hover { opacity: .9; }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:disabled { opacity: .45; cursor: not-allowed; }
.auth-btn--ghost {
  background: transparent;
  color: var(--text-soft, #55605F);
  border: 1px solid var(--border, #E8E8E4);
  width: auto;
  padding: 0 14px;
  height: 46px;
  white-space: nowrap;
  font-size: 13px;
}

.auth-hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary, #8A9191);
}
.auth-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #FBF1F1;
  border: 1px solid #EFD9D9;
  color: #A15C5C;
  font-size: 12.5px;
  line-height: 1.6;
  display: none;
}
.auth-error.is-open { display: block; }

.auth-back {
  margin-top: 16px;
  text-align: center;
}
.auth-back button {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--text-secondary, #8A9191);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 导航里的账号区 */
.account-menu { position: relative; }
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--border, #E8E8E4);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-soft, #55605F);
  cursor: pointer;
  max-width: 190px;
}
.account-chip:hover { border-color: var(--border-strong, #DADAD4); background: #fff; }
.account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-wash, #EDF1F0);
  color: var(--primary-deep, #8FA3A1);
  font-size: 12px;
  display: grid;
  place-items: center;
  flex: none;
  text-transform: uppercase;
}
.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border, #E8E8E4);
  border-radius: 14px;
  box-shadow: 0 18px 40px -18px rgba(44, 51, 51, .3);
  display: none;
  z-index: 60;
}
.account-drop.is-open { display: block; }
.account-drop .drop-meta {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border, #E8E8E4);
  margin-bottom: 6px;
}
.account-drop .drop-email {
  font-size: 12px;
  color: var(--text-secondary, #8A9191);
  word-break: break-all;
}
.account-drop .drop-credits {
  font-size: 13px;
  color: var(--text, #2C3333);
  margin-top: 4px;
}
.account-drop a,
.account-drop button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-soft, #55605F);
  cursor: pointer;
  text-decoration: none;
}
.account-drop a:hover,
.account-drop button:hover { background: var(--bg-alt, #F2F2EE); color: var(--text, #2C3333); }

@media (max-width: 560px) {
  .auth-card { padding: 26px 20px 22px; border-radius: 18px; }
  .account-chip { max-width: 130px; }
}

/* hidden 属性必须真正隐藏 —— .btn 自带 display:inline-flex 会盖掉 UA 的 [hidden] */
[hidden] { display: none !important; }
/* 账号名过长时省略，不要把导航撑开 */
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }