/* ===================== 登录界面样式 ===================== */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(160deg, #faf8f4 0%, #f5f0e6 100%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.auth-overlay.active {
  display: flex;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(61, 43, 31, 0.12);
  padding: 32px 28px;
  text-align: center;
  animation: authFadeIn 0.3s ease-out;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-mascot {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  background: #f5f0e6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: #3d2b1f;
  margin: 0 0 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: #5a4a3a;
  margin: 0 0 24px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e8e0d4;
  border-radius: 12px;
  font-size: 15px;
  background: #faf8f4;
  color: #3d2b1f;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: #b8c96e;
  background: #ffffff;
}

.auth-input::placeholder {
  color: #b8b0a0;
}

.auth-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.auth-btn:active { transform: scale(0.98); }

.auth-btn-primary {
  background: #b8c96e;
  color: #ffffff;
}

.auth-btn-primary:hover { background: #a8b95e; }

.auth-btn-primary:disabled {
  background: #d4d4d4;
  cursor: not-allowed;
  transform: none;
}

.auth-btn-secondary {
  background: #f5f0e6;
  color: #5a4a3a;
}

.auth-btn-secondary:hover { background: #ebe5d6; }

.auth-tip {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
  line-height: 1.5;
}

.auth-error {
  background: #fdeaea;
  color: #e74c3c;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}

.auth-error.active { display: block; }

.auth-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

.auth-step { display: none; }
.auth-step.active { display: block; }

.auth-back {
  background: none;
  border: none;
  color: #5a4a3a;
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  margin-top: 4px;
}

.auth-back:hover { text-decoration: underline; }

.auth-email-display {
  font-size: 14px;
  color: #3d2b1f;
  font-weight: 500;
  margin-bottom: 8px;
}

/* 登录后顶部的账号标识 */
.auth-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  background: rgba(184, 201, 110, 0.2);
  border-radius: 14px;
  font-size: 11px;
  color: #5a4a3a;
  max-width: 140px;
  overflow: hidden;
  cursor: pointer;
  margin-right: 6px;
  flex-shrink: 0;
}

.auth-badge-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f5f0e6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 14px;
  flex-shrink: 0;
}

.auth-badge-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-badge-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}

.auth-badge.active { display: inline-flex; }
.auth-badge:hover { background: rgba(184, 201, 110, 0.35); }

/* 同步状态指示 */
.sync-indicator {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 1000;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.9);
  color: #5a4a3a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: none;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.sync-indicator.active { display: inline-flex; }

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27ae60;
}

.sync-indicator.syncing .sync-dot {
  background: #f5b942;
  animation: syncPulse 1s ease-in-out infinite;
}

.sync-indicator.error .sync-dot { background: #e74c3c; }

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
