/* WORK LABS 全局统一认证与账号入口组件样式 */
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-auth-floating {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
}

.site-auth-nav {
  display: inline-flex;
  align-items: center;
}

.site-auth-guest,
.site-auth-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full, 9999px);
  background: var(--primary-light, rgba(37, 99, 235, 0.08));
  border: 1px solid var(--primary-border, rgba(37, 99, 235, 0.25));
  font-size: 12.5px;
  color: var(--text-main, #0f172a);
  font-weight: 500;
  user-select: none;
  max-width: 170px;
  line-height: 1.3;
}

.site-auth-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--primary, #2563eb);
}

.site-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: var(--radius-full, 9999px);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.3;
  box-sizing: border-box;
}

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

.site-auth-btn-login {
  background: var(--primary, #2563eb);
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.site-auth-btn-login:hover {
  background: var(--primary-hover, #1d4ed8);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.site-auth-btn-logout {
  background: var(--bg-surface-elevated, #f1f5f9);
  color: var(--text-muted, #475569);
  border-color: var(--border-subtle, rgba(0, 0, 0, 0.1));
}

.site-auth-btn-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

.site-auth-btn-logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 深色模式 / 独立沉浸暗色页面样式 */
[data-theme="dark"] .site-auth-badge,
.site-auth-floating .site-auth-badge {
  background: rgba(17, 24, 39, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .site-auth-username,
.site-auth-floating .site-auth-username {
  color: #93c5fd;
}

[data-theme="dark"] .site-auth-btn-logout,
.site-auth-floating .site-auth-btn-logout {
  background: rgba(17, 24, 39, 0.85);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .site-auth-btn-logout:hover,
.site-auth-floating .site-auth-btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.site-auth-floating .site-auth-btn-login {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* 显式浅色覆盖 */
html[data-theme="light"] .sub-nav-bar .site-auth-badge,
html[data-theme="light"] .header-actions .site-auth-badge {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: #0f172a;
  box-shadow: none;
}
html[data-theme="light"] .sub-nav-bar .site-auth-username,
html[data-theme="light"] .header-actions .site-auth-username {
  color: #2563eb;
}
html[data-theme="light"] .sub-nav-bar .site-auth-btn-logout,
html[data-theme="light"] .header-actions .site-auth-btn-logout {
  background: #f1f5f9;
  color: #475569;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: none;
}

@media (max-width: 680px) {
  .header-actions {
    gap: 4px;
    flex-wrap: nowrap;
  }
  .site-auth-floating {
    top: 10px;
    right: 12px;
  }
  .site-auth-badge {
    padding: 3px 6px;
    font-size: 11px;
    max-width: 80px;
  }
  .site-auth-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
}
