﻿/* ============================================================================
 * 认证与同步样式
 * 独立文件，避免污染主样式表
 * ==========================================================================*/

/* ---------------------------------------------------------------- 登录页
 * 左右分栏：左侧品牌区（深色），右侧表单区（跟随主题）
 * 窄屏 <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-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.lg-auth-tab {
  padding: 0 2px 11px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-faint);
  background: none;
  border: 0;
  cursor: default;
  position: relative;
}
.lg-auth-tab.active { color: var(--text); }
.lg-auth-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.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 {
  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;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .lg-auth-page { grid-template-columns: 1fr; }
  .lg-auth-visual { display: none; }
  .lg-auth-panel { padding: 32px 20px; }
}
/* ---------------------------------------------------------------- 用户徽标 */
.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); }
