/* ============ 登录弹窗 ============ */
.auth-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 180ms var(--ease);
}
.auth-layer.is-in { opacity: 1; }
.auth-layer.is-out { opacity: 0; }

.auth-veil {
  position: absolute;
  inset: 0;
  background: rgba(16, 34, 60, .38);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
}

.auth-box {
  position: relative;
  width: 404px;
  max-width: 100%;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(12, 32, 64, .28), 0 2px 0 rgba(255, 255, 255, .6) inset;
  overflow: hidden;
  transform: translateY(10px) scale(.985);
  opacity: .9;
  transition: transform 240ms var(--ease), opacity 240ms var(--ease);
}
.auth-layer.is-in .auth-box { transform: none; opacity: 1; }

.auth-box.shake { animation: authShake 320ms var(--ease); }
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}

.auth-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 24px 0;
}

.auth-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--primary) 0%, #5B8CFF 55%, #8FB4FF 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  box-shadow: 0 6px 14px rgba(47, 107, 255, .28);
}

.auth-headline { flex: 1; min-width: 0; }
.auth-headline h3 {
  font-size: 17px;
  line-height: 1.3;
  color: var(--text);
}
.auth-headline p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-x {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.auth-x:hover { background: #F0F5FD; color: var(--text); }
.auth-x svg { width: 16px; height: 16px; }
.auth-x svg path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }

.auth-tabs {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  margin: 18px 24px 0;
  padding: 4px;
  background: #EEF4FD;
  border-radius: 12px;
}
.auth-tab {
  height: 34px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.auth-tab.is-on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 58, 107, .10);
}

.auth-body { padding: 18px 24px 0; }

.auth-field {
  display: block;
  margin-bottom: 12px;
}
.auth-field > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: .01em;
}
.auth-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #FBFDFF;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.auth-field input::placeholder { color: #9FB0C6; }
.auth-field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .14);
}

.auth-hint {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-err {
  margin: 8px 0 0;
  font-size: 12px;
  color: #D8452F;
  display: none;
}
.auth-err.is-on { display: block; }

.auth-submit {
  width: 100%;
  height: 44px;
  margin-top: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #3C7CFF 0%, var(--primary) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 8px 18px rgba(47, 107, 255, .26);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.auth-submit:hover { filter: brightness(1.04); box-shadow: 0 10px 22px rgba(47, 107, 255, .3); }
.auth-submit:active { transform: translateY(1px); box-shadow: 0 5px 12px rgba(47, 107, 255, .24); }
.auth-submit.is-busy { cursor: progress; filter: grayscale(.08) brightness(.97); }

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px 18px;
  font-size: 11px;
  color: #93A5BB;
}
.auth-foot i {
  width: 1px;
  height: 10px;
  background: #D8E4F4;
}

html.auth-open { overflow: hidden; }

/* 顶栏用户 chip 上的云端小圆点 */
.cloud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2FB36B;
  box-shadow: 0 0 0 2px rgba(47, 179, 107, .18);
  margin-left: 2px;
}

@media (max-width: 480px) {
  .auth-layer { padding: 16px; align-items: end; }
  .auth-box { border-radius: 18px; }
  .auth-top { padding: 18px 18px 0; }
  .auth-tabs { margin: 16px 18px 0; }
  .auth-body { padding: 16px 18px 0; }
}
