:root {
  --bg: #070608;
  --surface: rgba(28, 28, 40, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #8b5cf6;
  --text: #f0f1f7;
  --muted: #9aa3bd;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body.auth-page {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

/* 独立登录页：与弹窗同款面板 */
.auth-standalone-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #131722;
  border: 1px solid #1e2230;
  border-radius: 16px;
  padding: 36px;
  box-shadow:
    0 0 0 1px rgba(91, 106, 240, 0.3),
    0 24px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.auth-standalone-panel .auth-modal-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.auth-brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.auth-brand-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 6px 0 0;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(10, 12, 18, 0.8);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.auth-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #5b6af0, #9b59f5);
  box-shadow: 0 4px 16px rgba(91, 106, 240, 0.35);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-error {
  font-size: 0.82rem;
  color: #f87171;
  margin-bottom: 12px;
  min-height: 1.2em;
}

/* —— 控制台顶栏 —— */
.auth-topbar-btn {
  background: linear-gradient(135deg, #5b6af0, #9b59f5);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(91, 106, 240, 0.3);
}

.auth-topbar-btn:hover {
  filter: brightness(1.06);
}

/* —— 登录弹窗 —— */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #131722;
  border: 1px solid #1e2230;
  border-radius: 16px;
  padding: 36px;
  box-shadow:
    0 0 0 1px rgba(91, 106, 240, 0.3),
    0 24px 48px rgba(0, 0, 0, 0.6);
  font-family: var(--font-ui);
  color: #e8eaf6;
  overflow: hidden;
}

.auth-modal-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5b6af0, #9b59f5);
  border-radius: 16px 16px 0 0;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: none;
  border: none;
  color: #4a4f6a;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.auth-modal-close:hover {
  color: #9ba3c7;
}

.auth-modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-modal-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(91, 106, 240, 0.15);
  border: 1px solid rgba(91, 106, 240, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c8ff5;
}

.auth-modal-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #e8eaf6;
}

.auth-modal-welcome {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #e8eaf6;
  line-height: 1.25;
}

.auth-modal-subtitle {
  margin: 0 0 24px;
  font-size: 0.88rem;
  color: #6b7289;
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #1e2230;
}

.auth-tab {
  flex: 1;
  padding: 10px 0 12px;
  background: none;
  border: none;
  color: #6b7289;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.auth-tab:hover {
  color: #9ba3c7;
}

.auth-tab.active {
  color: #e8eaf6;
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #5b6af0, #9b59f5);
  border-radius: 2px;
}

.auth-panel {
  animation: authPanelFade 0.2s ease;
}

@keyframes authPanelFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-panel-error {
  font-size: 0.82rem;
  color: #f87171;
  margin-bottom: 10px;
}

.auth-switch-hint {
  text-align: center;
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: #4a4f6a;
}

.auth-switch-link {
  background: none;
  border: none;
  padding: 0;
  color: #7c8ff5;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.auth-switch-link:hover {
  color: #9b59f5;
}

.auth-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.85;
}

.auth-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: 10px;
  border: 1px solid #1e2230;
  background: #0d0f14;
  color: #e8eaf6;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input--pwd {
  padding-right: 44px;
}

.auth-input::placeholder {
  color: #4a4f6a;
}

.auth-input:focus {
  border-color: rgba(91, 106, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(91, 106, 240, 0.12);
}

.auth-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  opacity: 0.55;
}

.auth-pwd-toggle:hover {
  opacity: 1;
}

.auth-modal-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #5b6af0, #9b59f5);
  box-shadow: 0 4px 16px rgba(91, 106, 240, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.auth-modal-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(91, 106, 240, 0.45);
}

.auth-modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-modal-terms {
  text-align: center;
  margin: 20px 0 0;
  font-size: 0.72rem;
  color: #4a4f6a;
  line-height: 1.5;
}

.auth-modal-terms a {
  color: #7c8ff5;
  text-decoration: none;
}

.auth-modal-terms a:hover {
  text-decoration: underline;
}
