/* ============================================================
 * 沪学门户 · 登录 / 会话 样式（书卷风延续）
 * ============================================================ */

/* ---- 导航登录按钮 ---- */
.auth-nav-wrap { position: relative; display: flex; align-items: center; margin-left: 14px; }
.auth-nav-login { white-space: nowrap; }
.auth-nav-btn-user {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 5px; border-radius: 999px;
  background: var(--paper, #faf6ef); color: var(--seal, #b03a2e);
  border: 1px solid rgba(255,255,255,.25); cursor: pointer; font-family: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.auth-nav-btn-user .auth-avatar-wrap {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--seal, #b03a2e); color: #fff;
}
.auth-nav-btn-user .auth-nav-label { font-size: 13px; color: var(--ink, #2b2a26); white-space: nowrap; }
.auth-avatar-sm {
  width: 100%; height: 100%; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
}
.auth-nav-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 200px; background: var(--card, #fffdf8); border: 1px solid rgba(43,42,38,.1);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(43,42,38,.12);
  padding: 16px; display: none;
}
.auth-nav-menu.open { display: block; }
.auth-menu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth-menu-head .auth-uname { margin: 0; }
.auth-menu-item {
  display: block; padding: 10px 12px; margin: 0 -8px; border-radius: 6px;
  color: var(--ink, #2b2a26); font-size: 14px; text-decoration: none;
}
.auth-menu-item:hover { background: rgba(43,42,38,.05); }
.auth-menu-item.is-disabled { color: var(--ink-soft, #8a877e); cursor: default; }
.auth-menu-item.is-disabled:hover { background: transparent; }
.auth-menu-logout { width: 100%; margin-top: 8px; }
.auth-uname { font-size: 13px; color: var(--ink, #2b2a26); margin: 8px 0 12px; word-break: break-all; }
.auth-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; margin-right: 10px;
  background: #efd3a8; color: #7a4e1a; font-weight: 700; font-size: 18px;
}

/* ---- 模态框 ---- */
.auth-modal .modal-card { max-width: 420px; }
.auth-card { padding: 4px 2px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h3 { font-family: var(--serif, "Noto Serif SC", serif); font-size: 22px; margin: 0 0 6px; color: var(--ink, #2b2a26); }
.auth-head p { font-size: 13px; color: var(--muted, #6e6a60); margin: 0; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field span { font-size: 13px; color: var(--ink, #2b2a26); }
.auth-field input {
  padding: 11px 12px; border: 1px solid rgba(43,42,38,.18); border-radius: 4px;
  font-size: 15px; font-family: inherit; background: var(--paper, #faf6ef);
}
.auth-field input:focus { outline: none; border-color: var(--accent, #b3643a); }

.auth-msg { min-height: 18px; font-size: 13px; color: var(--accent, #b3643a); }
.auth-msg.err { color: #a33; }
.auth-submit { width: 100%; margin-top: 4px; }

.auth-switch { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted, #6e6a60); }
.btn-link { background: none; border: none; color: var(--accent, #b3643a); cursor: pointer; font-size: 13px; font-family: inherit; text-decoration: underline; }
.auth-current { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(43,42,38,.12); display: flex; align-items: center; font-size: 13px; color: var(--muted, #6e6a60); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 4px; font-size: 14px; font-family: inherit; cursor: pointer; border: none; transition: background .2s; }
.btn-primary { background: var(--accent, #b3643a); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid rgba(43,42,38,.25); color: var(--ink, #2b2a26); }

/* 移动端：让登录按钮与 brand 同排（order 2 紧随 logo），避免 flex 换行时错位到下一行成孤立色块 */
@media (max-width: 860px) {
  .auth-nav-wrap { margin-left: 0; order: 2; }
  .auth-nav-login { padding: 7px 12px; font-size: 13px; }
}
@media (max-width: 740px) {
  /* 手机端：「我的」入口顶到导航最右侧，汉堡在其左侧 */
  .auth-nav-wrap { order: 5; margin-left: auto; }
}