/* 登录门禁与右上角账号胶囊 —— 只作用于新增的界面元素 */
.auth-gate {
  position: fixed;
  inset: 0;
  /* 必须高于启动加载层 #boot（z-index: 999），否则登录表单会被遮住 */
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(94, 106, 210, 0.18), transparent 60%), var(--bg, #0b0d12);
  backdrop-filter: blur(6px);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel, #12151d);
  border: 1px solid var(--line, #232838);
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  color: var(--fg, #e7eaf3);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.auth-brand span {
  font-size: 12px;
  color: var(--muted, #8b93a7);
}
.auth-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(140deg, #4f6bff, #8f5bff);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line, #232838);
  border-radius: 12px;
  background: var(--panel-2, #171b26);
  margin-bottom: 20px;
}
.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted, #8b93a7);
  font-size: 13.5px;
  padding: 9px 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.auth-tab.on {
  background: var(--panel, #12151d);
  color: var(--fg, #e7eaf3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.auth-field {
  display: block;
  margin-bottom: 14px;
}
.auth-field span {
  display: block;
  font-size: 12.5px;
  color: var(--muted, #8b93a7);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--fg, #e7eaf3);
  background: var(--panel-2, #171b26);
  border: 1px solid var(--line, #232838);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-field input:focus {
  border-color: #4f6bff;
  box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.18);
}

.auth-error {
  min-height: 18px;
  margin: 2px 0 12px;
  font-size: 12.5px;
  color: #f87171;
}

.auth-submit {
  width: 100%;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(140deg, #4f6bff, #7a5bff);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.auth-submit:hover { transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.auth-tip {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted, #8b93a7);
  text-align: center;
}

.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 6px 0 12px;
  margin-right: 6px;
  border: 1px solid var(--line, #232838);
  border-radius: 999px;
  background: var(--panel-2, #171b26);
  font-size: 12px;
  color: var(--muted, #8b93a7);
}
.auth-user-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg, #e7eaf3);
}
.auth-user button {
  border: 0;
  background: transparent;
  color: var(--muted, #8b93a7);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
}
.auth-user button:hover { color: #f87171; }

[data-theme="light"] .auth-gate {
  background: radial-gradient(1200px 600px at 50% -10%, rgba(79, 107, 255, 0.12), transparent 60%), #f6f7fb;
}
[data-theme="light"] .auth-card {
  background: #fff;
  border-color: #e6e8f0;
  color: #1a1d26;
  box-shadow: 0 24px 60px rgba(23, 27, 38, 0.14);
}
[data-theme="light"] .auth-tabs { background: #f2f4f9; border-color: #e6e8f0; }
[data-theme="light"] .auth-tab.on { background: #fff; color: #1a1d26; }
[data-theme="light"] .auth-field input { background: #f7f8fc; border-color: #e6e8f0; color: #1a1d26; }
[data-theme="light"] .auth-user { background: #f2f4f9; border-color: #e6e8f0; }
[data-theme="light"] .auth-user-name { color: #1a1d26; }
