/* ============================================================================
 * 认证与同步样式
 * 独立文件，避免污染主样式表
 * ==========================================================================*/

/* ---------------------------------------------------------------- 登录页
 * 左右分栏：左侧品牌区（深色），右侧表单区（跟随主题）
 * 窄屏 <900px 收成单栏，隐藏左侧
 * ---------------------------------------------------------------------- */
.lg-auth-page {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--bg);
  overflow: auto;
}

/* ---------- 左侧品牌区 ---------- */
.lg-auth-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #232c3a 0%, #1f2937 55%, #2a3648 100%);
  color: #fff;
  padding: 46px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.lg-auth-visual::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  right: -180px;
  top: -160px;
  background: radial-gradient(circle, rgba(90, 140, 210, .30), transparent 68%);
  pointer-events: none;
}
.lg-auth-visual::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  left: -140px;
  bottom: -190px;
  background: radial-gradient(circle, rgba(120, 110, 200, .26), transparent 68%);
  pointer-events: none;
}
.lg-auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
}
.lg-auth-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, #48ab93, #0081ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  flex: none;
  box-shadow: 0 8px 20px -8px rgba(0, 129, 255, .85);
}
.lg-auth-brand .bn {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .06em;
}
.lg-auth-brand .bs {
  font-size: 10.5px;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-top: 2px;
}
.lg-auth-copy {
  position: relative;
  max-width: 430px;
}
.lg-auth-copy h2 {
  margin: 0;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: .01em;
}
.lg-auth-copy h2 em {
  font-style: normal;
  color: #7fb8e8;
}
.lg-auth-copy p {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .62);
  line-height: 1.85;
}
.lg-auth-points {
  display: flex;
  flex-direction: column;
  gap: 11px;
  position: relative;
}
.lg-auth-point {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .72);
  line-height: 1.5;
}
.lg-auth-point .ap {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: none;
}
.lg-auth-foot {
  position: relative;
  font-size: 11px;
  color: rgba(255, 255, 255, .38);
}

/* ---------- 右侧表单区 ---------- */
.lg-auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  overflow-y: auto;
}
.lg-auth-card {
  width: min(392px, 100%);
}
/* 登录标题（取代原来的标签切换） */
.lg-auth-title {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.lg-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- 表单字段 ---------- */
.lg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lg-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
}
.lg-input {
  width: 100%;          /* 撑满容器，和下面的按钮同宽 */
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.lg-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lg-input::placeholder { color: var(--text-faint); }

.lg-field-error {
  padding: 8px 11px;
  border-radius: 7px;
  background: rgba(239, 95, 95, .12);
  color: #ef5f5f;
  font-size: 12px;
  border: 1px solid rgba(239, 95, 95, .3);
}
.lg-btn-submit {
  height: 42px;
  margin-top: 4px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.lg-btn-submit:hover:not(:disabled) { filter: brightness(1.1); }
.lg-btn-submit:active:not(:disabled) { transform: translateY(1px); }
.lg-btn-submit:disabled { opacity: .62; cursor: default; }

.lg-auth-hint {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
}

/* ---------- 窄屏 ---------- */
/* ============================================================
 * 手机 / 窄屏（<900px）
 *
 * 原来直接把左侧品牌区 display:none，整屏只剩浅色表单，
 * 白底一片、没有层次，看起来像没加载完。
 * 现在改成「上方深色品牌头 + 下方表单卡片」，保留视觉锚点。
 * ============================================================ */
@media (max-width: 900px) {
  .lg-auth-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    background: var(--bg);
    align-content: start;
  }

  /* ---------- 顶部品牌区：品牌 + 标题，隐藏要点列表 ---------- */
  .lg-auth-visual {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px 28px;
    border-radius: 0 0 22px 22px;
    min-height: 0;
    justify-content: flex-start;
  }
  .lg-auth-visual::before { width: 300px; height: 300px; right: -130px; top: -120px; }
  .lg-auth-visual::after { width: 220px; height: 220px; left: -100px; bottom: -130px; }
  .lg-auth-brand .bn { font-size: 15px; }
  .lg-auth-logo { width: 34px; height: 34px; font-size: 17px; }

  .lg-auth-copy { max-width: none; }
  .lg-auth-copy h2 { font-size: 19px; line-height: 1.5; }
  .lg-auth-copy p { font-size: 12.5px; line-height: 1.7; margin-top: 10px; }

  /* 手机上不放功能要点和版本行，省空间 */
  .lg-auth-points { display: none; }
  .lg-auth-foot { display: none; }

  /* ---------- 表单区 ---------- */
  .lg-auth-panel {
    align-items: flex-start;
    padding: 18px 16px 36px;
  }
  .lg-auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 18px 18px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
  }
  .lg-auth-title { font-size: 16px; margin-bottom: 16px; }

  /* 输入框和按钮加大，方便手指点 */
  .lg-input { height: 44px; font-size: 15px; }
  .lg-btn-submit { height: 46px; font-size: 15px; }

  .lg-auth-notice { margin-top: 14px; padding: 11px 12px; }
  .lg-auth-notice-t { font-size: 12px; }
  .lg-auth-notice p { font-size: 11.5px; line-height: 1.7; }
  .lg-auth-hint { margin-top: 12px; }
}

/* 超窄屏（<380px）再收一收 */
@media (max-width: 380px) {
  .lg-auth-visual { padding: 20px 15px 24px; }
  .lg-auth-copy h2 { font-size: 17px; }
  .lg-auth-copy p { font-size: 12px; }
  .lg-auth-panel { padding: 14px 11px 30px; }
  .lg-auth-card { padding: 17px 15px 15px; }
  .lg-auth-notice p { font-size: 11px; }
}
/* ---------------------------------------------------------------- 用户徽标 */
.lg-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.lg-user-btn:hover { background: var(--head-hover); }
.lg-user-av {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.lg-user-name { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 用户菜单 */
.lg-user-menu {
  position: fixed;
  z-index: 10010;
  min-width: 208px;
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-line);
  border-radius: 9px;
  box-shadow: var(--shadow-panel);
  padding: 6px;
}
.lg-user-menu-head {
  padding: 8px 9px 7px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}
.lg-user-menu-head b { display: block; font-size: 12.5px; color: var(--text); }
.lg-user-menu-head span { font-size: 10.5px; color: var(--text-faint); }
.lg-user-menu-info {
  padding: 6px 9px 8px;
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.7;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}
.lg-user-menu-dim { color: var(--text-faint); }
.lg-user-menu-warn { color: var(--warn); font-weight: 600; }
.lg-user-menu-item {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.lg-user-menu-item:hover { background: var(--accent-soft); }
.lg-user-menu-item.is-danger { color: var(--err); }
.lg-user-menu-item.is-danger:hover { background: rgba(239, 95, 95, .14); }

/* ---------------------------------------------------------------- 只读提示条 */
.lg-readonly-bar {
  padding: 7px 16px;
  background: rgba(224, 169, 74, .14);
  color: var(--warn);
  font-size: 11.5px;
  text-align: center;
  border-bottom: 1px solid rgba(224, 169, 74, .3);
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- 同步状态 */
.lg-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: default;
}
.lg-sync-badge.is-pending {
  background: rgba(224, 169, 74, .16);
  color: var(--warn);
}
.lg-sync-badge.is-error {
  background: rgba(239, 95, 95, .16);
  color: var(--err);
}

/* ---------------------------------------------------------------- 版本更新提示 */
.lg-update-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
  animation: lg-slide-down .25s ease;
}
@keyframes lg-slide-down {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
.lg-update-ico { font-size: 15px; }
.lg-update-text { flex: 1 1 auto; }
.lg-update-btn {
  padding: 4px 14px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.lg-update-btn:hover { filter: brightness(.95); }
.lg-update-btn:disabled { opacity: .7; cursor: default; }
.lg-update-x {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .8);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.lg-update-x:hover { color: #fff; }

/* ---------------------------------------------------------------- 通用模态框 */
.lg-modal {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .5);
  padding: 20px;
}
.lg-modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lg-modal-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; color: var(--text); }
.lg-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }



/* 模态框按钮（改密码弹窗用） */
.lg-modal-btn {
  padding: 7px 18px;
  font: inherit;
  font-size: 12.5px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.lg-modal-btn:hover { background: var(--head-hover); }
.lg-modal-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.lg-modal-btn.is-primary:hover { filter: brightness(1.1); }

/* 表单里的说明文字（label 后面的小灰字） */
.lg-field-label i {
  font-style: normal;
  font-weight: 400;
  color: var(--text-faint);
  font-size: 11px;
  margin-left: 4px;
}

/* 成功提示 */
.lg-field-ok {
  padding: 8px 11px;
  border-radius: 7px;
  background: rgba(72, 171, 147, .13);
  color: #48ab93;
  font-size: 12px;
  border: 1px solid rgba(72, 171, 147, .3);
}

/* 空闲自动登出提醒条 */
.lg-idle-warn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10040;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid rgba(224, 169, 74, .5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  font-size: 12.5px;
  color: var(--text);
  animation: lg-idle-in .22s ease;
}
@keyframes lg-idle-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.lg-idle-ico { font-size: 15px; }
.lg-idle-text b { color: var(--warn); font-weight: 700; }
.lg-idle-btn {
  padding: 5px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lg-idle-btn:hover { filter: brightness(1.1); }

/* ---------------------------------------------------------------- 账号申请提示
 * 明确告诉用户：不能自己注册，账号由管理员创建后私发。
 * 做得比普通说明文字醒目一点，避免有人到处找注册入口。
 */
.lg-auth-notice {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.lg-auth-notice-t {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 6px;
}
.lg-auth-notice p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--text-dim);
}
.lg-auth-notice b {
  color: var(--accent);
  font-weight: 600;
}
