/* ============================================================
   防火云 · 统一账号弹窗（登录 / 注册） .am-*
   与官网设计系统一致：深空底 + 品牌红渐变 + 锐利几何
   依赖：css/style.css 提供的 CSS 变量
   ============================================================ */

body.am-lock { overflow: hidden; }

.am-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(3, 6, 12, .74);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s;
}
.am-mask.on { opacity: 1; visibility: visible; }

.am-box {
  position: relative; width: min(920px, 100%); max-height: calc(100vh - 48px);
  display: grid; grid-template-columns: 340px 1fr;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  transform: translateY(14px) scale(.985);
  transition: transform .26s var(--ease);
}
.am-mask.on .am-box { transform: none; }

.am-x {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .06); color: var(--ink-2);
  font-size: 19px; line-height: 1; cursor: pointer; transition: .16s;
}
.am-x:hover { background: rgba(230, 57, 70, .2); color: #fff; }

/* ---- 左侧品牌面板 ---- */
.am-side {
  position: relative; padding: 34px 28px; color: #fff; overflow: hidden;
  background:
    radial-gradient(420px 260px at 10% 0%, rgba(230, 57, 70, .30), transparent 62%),
    radial-gradient(360px 240px at 100% 100%, rgba(59, 130, 246, .22), transparent 60%),
    linear-gradient(160deg, #0b1220, #101b31);
  border-right: 1px solid var(--line);
}
.am-side::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px;
  background: var(--grad-red);
}
.am-brand { display: flex; align-items: center; gap: 10px; }
.am-brand .lg {
  width: 36px; height: 36px; border-radius: 9px; background: var(--grad-red);
  display: grid; place-items: center; font-weight: 900; font-size: 14px; letter-spacing: .5px;
}
.am-brand b { display: block; font-size: 15px; letter-spacing: .06em; }
.am-brand span { display: block; font-size: 9.5px; letter-spacing: .18em; color: var(--ink-3); }

.am-kicker {
  display: inline-block; margin: 26px 0 12px; padding: 3px 9px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; color: #ff97a0;
  border: 1px solid rgba(230, 57, 70, .42); border-radius: 4px;
  background: rgba(230, 57, 70, .10);
}
.am-side h3 { font-size: 23px; line-height: 1.42; font-weight: 800; letter-spacing: .01em; }
.am-desc { margin: 12px 0 0; font-size: 12.5px; line-height: 1.85; color: #a9b8cf; }

.am-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 13px; }
.am-points li { padding-left: 13px; border-left: 2px solid rgba(230, 57, 70, .55); }
.am-points b { display: block; font-size: 12.5px; color: #fff; }
.am-points span { display: block; font-size: 11.5px; color: #93a3bb; margin-top: 2px; line-height: 1.6; }

.am-safe {
  margin-top: 22px; padding-top: 13px; border-top: 1px dashed rgba(255, 255, 255, .12);
  font-size: 11px; color: #7d8ca4; line-height: 1.7;
}

/* ---- 右侧表单区 ---- */
.am-main { padding: 30px 34px 26px; overflow-y: auto; max-height: calc(100vh - 48px); }
.am-tabs { display: flex; gap: 4px; padding: 3px; background: rgba(255, 255, 255, .05); border-radius: 8px; }
.am-tabs button {
  flex: 1; height: 34px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 700;
  transition: .18s var(--ease);
}
.am-tabs button.on { background: var(--grad-red); color: #fff; box-shadow: 0 4px 14px rgba(230, 57, 70, .3); }
.am-sub { margin: 12px 0 18px; font-size: 12.5px; color: var(--ink-3); }

.am-field { margin-bottom: 13px; }
.am-field label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.am-field label i { color: var(--red-hi); font-style: normal; }
.am-input {
  width: 100%; height: 42px; padding: 0 13px; box-sizing: border-box;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2);
  border-radius: 8px; color: var(--ink); font-size: 13.5px; outline: none;
  transition: .16s var(--ease);
}
.am-input::placeholder { color: #64748b; }
.am-input:focus {
  border-color: rgba(230, 57, 70, .6); background: rgba(230, 57, 70, .05);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, .12);
}

.am-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: 12px; }
.am-row.center { justify-content: center; }
.am-link, .am-forgot { color: var(--blue-hi); cursor: pointer; transition: .15s; }
.am-link:hover, .am-forgot:hover { color: #fff; text-decoration: underline; }
.am-forgot { color: var(--ink-3); }

.am-btn {
  width: 100%; height: 44px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--grad-red); color: #fff; font-size: 14.5px; font-weight: 800; letter-spacing: .1em;
  box-shadow: 0 8px 22px rgba(230, 57, 70, .28); transition: .18s var(--ease);
}
.am-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.am-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.am-btn.loading { position: relative; color: transparent; }
.am-btn.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 17px; height: 17px; border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff; border-radius: 50%; animation: amspin .7s linear infinite;
}
@keyframes amspin { to { transform: rotate(360deg); } }

.am-err { display: none; margin-top: 12px; padding: 9px 12px; border-radius: 7px; font-size: 12.5px; line-height: 1.6; }
.am-err.on { display: block; }
.am-err.err { background: rgba(230, 57, 70, .12); border: 1px solid rgba(230, 57, 70, .3); color: #ff97a0; }
.am-err.ok { background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .3); color: #6ee7b7; }
.am-err.info { background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .3); color: #93c5fd; }

/* ---- 面板（同一时刻只显示一个）+ 底部轻切换（大厂式：主表单 + 次要方式链接） ---- */
.am-panel { min-width: 0; }
.am-alts {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.am-alts span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: .15s;
  white-space: nowrap;
}
.am-alts span:hover { color: #fff; }
.am-alts .ic { font-style: normal; font-size: 13px; color: var(--blue-hi); }
.am-alts .ic.wx { color: #34d399; }

/* ---- 选填项折叠（默认收起，降低表单视觉负担） ---- */
.am-more {
  margin: 2px 0 14px; padding: 0 12px;
  border: 1px dashed var(--line-2); border-radius: 8px;
}
.am-more summary {
  padding: 9px 0; font-size: 12px; color: var(--ink-3);
  cursor: pointer; list-style: none; user-select: none; transition: .15s;
}
.am-more summary:hover { color: var(--ink); }
.am-more summary::-webkit-details-marker { display: none; }
.am-more summary::before { content: "＋ "; color: var(--blue-hi); }
.am-more[open] summary::before { content: "－ "; }
.am-more[open] summary { border-bottom: 1px dashed var(--line-2); margin-bottom: 12px; }

/* ---- 验证码输入组 ---- */
.am-code { display: flex; gap: 8px; }
.am-code .am-input { flex: 1 1 auto; }
.am-code .am-btn.code {
  flex: 0 0 auto; width: 118px; height: 42px; padding: 0 12px; letter-spacing: 0;
  font-size: 12.5px; font-weight: 700; box-shadow: none;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); color: var(--ink);
}
.am-code .am-btn.code:hover { background: rgba(230, 57, 70, .16); color: #fff; border-color: rgba(230, 57, 70, .5); }
.am-code .am-btn.code:disabled { opacity: .6; color: var(--ink-3); }
.am-tipmini { margin: -4px 0 14px; font-size: 11.5px; line-height: 1.7; color: var(--ink-3); }

/* ---- 微信扫码面板 ---- */
.am-wx { padding: 4px 0 8px; }
.am-wxbox {
  height: 178px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border-radius: 10px; border: 1px dashed var(--line-2); background: rgba(255, 255, 255, .03);
  text-align: center; padding: 0 18px;
}
.am-wxbox .ico { font-size: 34px; color: #4ade80; }
.am-wxbox em { font-style: normal; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.am-wxbox em b { color: #fff; }
.am-wxbox.mock .ico { color: var(--gold); }
.am-wxbox.mock { border-color: rgba(244, 168, 37, .45); background: rgba(244, 168, 37, .05); }
.am-btn.wx { margin-top: 14px; background: linear-gradient(135deg, #1a7f4b, #34d399); box-shadow: 0 8px 22px rgba(52, 211, 153, .22); }
.am-btn.wx:hover { filter: brightness(1.08); }

.am-agree { margin: 14px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--ink-3); }

/* ============================================================
   登录 / 注册落地页（弹窗承载页） .auth-*
   ============================================================ */
.auth-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 2.6vw, 30px); }
.auth-acts .btn { margin-top: 0; }
.auth-note { margin-top: 16px; font-size: 12.5px; line-height: 1.8; color: var(--ink-3); }

.auth-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.auth-pt {
  display: flex; gap: 12px; padding: 18px 16px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); transition: .2s var(--ease);
}
.auth-pt:hover { border-color: rgba(230, 57, 70, .42); transform: translateY(-2px); }
.auth-pt .ic {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; font-size: 15px;
  background: rgba(230, 57, 70, .12); color: var(--red-hi);
}
.auth-pt b { display: block; font-size: 13.5px; color: #fff; margin-bottom: 4px; }
.auth-pt span { display: block; font-size: 12px; line-height: 1.75; color: var(--ink-2); }

.auth-demo {
  margin-top: 22px; padding: 14px 18px; border-radius: var(--r);
  background: rgba(255, 255, 255, .04); border: 1px dashed var(--line-2);
  font-size: 12.5px; line-height: 1.9; color: var(--ink-2);
}
/* 对比度修复（2026-09-21）：登录页演示账号提示框位于 #f4f6fa 浅底上，
   --gold(#f4a825) 对比度仅 1.86、--ink-3(#8695a9) 仅 2.83，均低于 4.5 */
.auth-demo b { color: #8a5c05; }
.auth-demo span { display: block; margin-top: 4px; color: #536577; }

@media (max-width: 1024px) { .auth-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .auth-grid { grid-template-columns: 1fr; } .auth-acts .btn { flex: 1 1 auto; justify-content: center; } }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .am-box { grid-template-columns: 1fr; max-height: calc(100vh - 32px); overflow-y: auto; }
  .am-side { padding: 22px 22px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .am-side h3 { font-size: 19px; }
  .am-points { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .am-safe { display: none; }
  .am-main { padding: 22px 20px; max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .am-mask { padding: 0; align-items: flex-end; }
  .am-box { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; transform: translateY(30px); }
  .am-mask.on .am-box { transform: none; }
  .am-points { grid-template-columns: 1fr; gap: 8px; }
  .am-desc { display: none; }
  .am-side { padding: 18px 18px 14px; }
  .am-x { top: 8px; right: 8px; }
}

/* ============================================================
   导航登录态：用户头像 + 下拉菜单（auth-modal.js 维护）
   配色对齐 .nav-login（白底导航、#37475c 字、红系强调）
   ============================================================ */
.nv-user { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 10px 5px 5px; border-radius: 999px; border: 1.5px solid transparent;
  transition: all .22s var(--ease); outline: none; }
.nv-user:hover, .nv-user.open { background: #fff; border-color: #d5dfec; box-shadow: 0 2px 12px rgba(10,30,60,.08); }
.nv-av { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(10,30,60,.18); }
.nv-av-tx { color: #fff; font-size: 15px; font-weight: 800; font-family: var(--f-body); line-height: 1; }
.nv-av-img { width: 100%; height: 100%; object-fit: cover; }
.nv-nm { font-size: 14px; font-weight: 700; color: #37475c; max-width: 96px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.nv-caret { color: #8595a9; flex-shrink: 0; transition: transform .22s var(--ease); }
.nv-user.open .nv-caret { transform: rotate(180deg); }
.nv-menu { position: absolute; top: calc(100% + 10px); right: 0; min-width: 178px; z-index: 60;
  background: #fff; border: 1px solid #e3e9f0; border-radius: var(--r); padding: 7px;
  box-shadow: 0 16px 48px rgba(10,30,60,.14); opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s; }
.nv-user.open .nv-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nv-menu-hd { display: flex; align-items: center; gap: 7px; padding: 8px 10px 10px;
  border-bottom: 1px dashed #eef2f7; margin-bottom: 5px; }
.nv-menu-hd b { font-size: 13.5px; color: #0d1a2e; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.nv-menu a { display: block; padding: 9px 11px; border-radius: var(--r-sm); font-size: 13.5px;
  color: #37475c; transition: all .18s; }
.nv-menu a:hover { background: #f2f6fb; color: var(--red-dark); }
.nv-menu .nv-out { color: #c1121f; border-top: 1px dashed #eef2f7; border-radius: 0 0 var(--r-sm) var(--r-sm);
  margin-top: 4px; padding-top: 10px; }
.nv-menu .nv-out:hover { background: #fdeced; color: #c1121f; }
@media (max-width: 900px) { .nv-nm { display: none; } .nv-user { padding: 4px; } }
