/* ============================================================
   新试卷网 · 账号系统样式（入口 / 登录注册弹窗 / 用户菜单 / 升级弹窗）
   依赖 site.css 的令牌：--color-primary / --radius-md / --radius-lg
   ============================================================ */

/* ---------- 顶部入口容器（位于头部最右端·右上角） ---------- */
.auth-entry { display: flex; align-items: center; gap: 8px; flex-shrink: 0; order: 1; }

.auth-login-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 42px; padding: 0 20px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .16);
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all .18s ease; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(10, 30, 80, .18);
}
.auth-login-btn:hover { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .85); }
.auth-login-btn svg { width: 18px; height: 18px; }

/* ---------- 已登录用户 chip ---------- */
.auth-user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px 0 9px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .14);
  color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: all .18s ease; max-width: 240px;
}
.auth-user-chip:hover { background: rgba(255, 255, 255, .24); }
.auth-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: var(--color-primary, #056de8);
  font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-caret { font-size: 10px; opacity: .8; }

/* 等级小徽标（下拉菜单内） */
.auth-tier {
  display: inline-flex; align-items: center;
  padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
}
.auth-tier-free      { background: #f1f5f9; color: #475569; }
.auth-tier-monthly   { background: #e0f2fe; color: #0369a1; }
.auth-tier-quarterly { background: #dcfce7; color: #15803d; }
.auth-tier-halfyear  { background: #fef3c7; color: #b45309; }
.auth-tier-yearly    { background: #ffe4e6; color: #be123c; }
.auth-tier-lifetime  { background: #ede9fe; color: #6d28d9; }
.auth-tier-admin     { background: #1b3b8f; color: #fff; }

/* ---------- 用户下拉菜单 ---------- */
.auth-menu-wrap { position: relative; }
.auth-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  width: 264px; padding: 6px;
  background: #fff; border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 32px rgba(15, 23, 43, .16);
  display: none;
}
.auth-menu.open { display: block; animation: authMenuIn .16s ease; }
@keyframes authMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.auth-menu-head { padding: 10px 10px 8px; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.auth-menu-email { font-size: 13px; font-weight: 600; color: #0f172a; word-break: break-all; }
.auth-menu-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.auth-menu-exp { font-size: 11px; color: #94a3b8; }

.auth-menu-quota { padding: 8px 10px; margin: 2px 0 4px; background: #f8fafc; border-radius: 8px; }
.auth-menu-quota-row { display: flex; justify-content: space-between; font-size: 12px; color: #475569; line-height: 1.9; }
.auth-menu-quota-row b { color: #0f172a; font-family: var(--font-serif-num, ui-monospace, monospace); }
.auth-menu-quota-row .low { color: #dc2626; }

.auth-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; font-size: 13px; color: #334155;
  cursor: pointer; text-align: left; text-decoration: none;
  transition: background .15s ease;
}
.auth-menu-item:hover { background: #f1f5f9; }
.auth-menu-item.danger { color: #dc2626; }
.auth-menu-item.danger:hover { background: #fef2f2; }
.auth-menu-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.auth-menu-sep { height: 1px; background: #f1f5f9; margin: 4px 0; }

/* ---------- 弹窗骨架 ---------- */
.auth-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 43, .55);
  display: none; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.auth-mask.open { display: flex; animation: authFadeIn .18s ease; }
@keyframes authFadeIn { from { opacity: 0; } to { opacity: 1; } }

.auth-modal {
  width: 100%; max-width: 480px;
  background: #fff; border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 43, .28);
  padding: 30px 32px 28px; position: relative;
  animation: authPopIn .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes authPopIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

.auth-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: none; color: #94a3b8; font-size: 18px; line-height: 1;
  cursor: pointer; transition: all .15s ease;
}
.auth-modal-close:hover { background: #f1f5f9; color: #334155; }

.auth-modal-title { font-size: 21px; font-weight: 800; color: #0f172a; letter-spacing: -.01em; }
.auth-modal-sub { font-size: 13px; color: #64748b; margin-top: 5px; line-height: 1.6; }

/* 登录 / 注册 选项卡 */
.auth-tabs {
  display: flex; gap: 4px; margin: 20px 0 18px;
  background: #f1f5f9; border-radius: 10px; padding: 4px;
}
.auth-tab {
  flex: 1; padding: 9px 0; border: 0; border-radius: 8px;
  background: none; font-size: 14.5px; font-weight: 600; color: #64748b;
  cursor: pointer; transition: all .15s ease;
}
.auth-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 43, .12); }

/* 表单 */
.auth-field { margin-bottom: 16px; }
.auth-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 7px; }
.auth-input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--color-slate-200, #e2e8f0); border-radius: 10px;
  font-size: 15px; color: #0f172a; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.auth-input:focus { border-color: var(--color-primary, #056de8); box-shadow: 0 0 0 3px rgba(5, 109, 232, .14); }
.auth-input::placeholder { color: #b6c2d2; }

.auth-code-row { display: flex; gap: 8px; }
.auth-code-row .auth-input { flex: 1; }
.auth-code-btn {
  flex-shrink: 0; height: 46px; padding: 0 14px;
  border: 1px solid var(--color-primary, #056de8); border-radius: 10px;
  background: #fff; color: var(--color-primary, #056de8);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.auth-code-btn:hover:not(:disabled) { background: rgba(5, 109, 232, .06); }
.auth-code-btn:disabled { border-color: #e2e8f0; color: #94a3b8; cursor: not-allowed; background: #f8fafc; }

.auth-submit {
  width: 100%; height: 48px; margin-top: 6px;
  border: 0; border-radius: 10px;
  background: var(--color-primary, #056de8); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-submit:hover:not(:disabled) { background: #0461c9; }
.auth-submit:disabled { background: #aebfd6; color: rgba(255, 255, 255, .9); cursor: not-allowed; box-shadow: none; }

.auth-error {
  display: none; margin-bottom: 12px; padding: 8px 12px;
  border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca;
  font-size: 12.5px; color: #b91c1c; line-height: 1.6;
}
.auth-error.show { display: block; }

/* 两次密码不一致提示（确认密码栏下方） */
.auth-pwd-tip { display: none; margin: -8px 0 12px; font-size: 12px; color: #dc2626; line-height: 1.5; }
.auth-pwd-tip.show { display: block; }

.auth-hint { margin-top: 14px; font-size: 11.5px; color: #94a3b8; line-height: 1.7; text-align: center; }
.auth-hint a { color: var(--color-primary, #056de8); text-decoration: none; }

/* ---------- 升级会员弹窗 ---------- */
.auth-upgrade-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.auth-upgrade-table th, .auth-upgrade-table td {
  padding: 9px 10px; font-size: 13px; text-align: center;
  border-bottom: 1px solid #f1f5f9;
}
.auth-upgrade-table th { font-size: 12px; color: #64748b; font-weight: 600; background: #f8fafc; }
.auth-upgrade-table td:first-child { text-align: left; font-weight: 600; color: #0f172a; }
.auth-upgrade-table .num { font-family: var(--font-serif-num, ui-monospace, monospace); font-weight: 700; color: #0f172a; }
.auth-upgrade-table tr.current td { background: #f0f9ff; }
.auth-upgrade-table tr.current td:first-child::after {
  content: '当前'; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: var(--color-primary, #056de8); color: #fff; font-size: 10px; font-weight: 600;
}
.auth-upgrade-note {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #fde68a;
  font-size: 12px; color: #92400e; line-height: 1.7;
}
/* 收款码 / 管理员微信二维码（两张并排居中） */
.auth-upgrade-qr {
  display: flex; justify-content: center; gap: 18px;
  margin-top: 14px;
}
.auth-upgrade-qr figure { margin: 0; text-align: center; }
.auth-upgrade-qr img {
  width: 132px; height: 132px; object-fit: cover;
  border: 1px solid #e2e8f0; border-radius: 10px; display: block;
}
.auth-upgrade-qr figcaption {
  margin-top: 6px; font-size: 11.5px; color: #64748b; line-height: 1.5;
}
@media (max-width: 640px) {
  .auth-upgrade-qr { gap: 12px; }
  .auth-upgrade-qr img { width: 112px; height: 112px; }
}

/* ---------- 手机端适配 ---------- */
@media (max-width: 640px) {
  .auth-modal { padding: 24px 20px 22px; }
  .auth-menu { width: 240px; }
  .auth-user-chip { max-width: 160px; }
  .auth-login-btn { height: 38px; padding: 0 14px; font-size: 14px; }
  .auth-user-chip { height: 38px; }
}
